### HTML Setup for Materialize Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html Example of how to link Materialize CSS and JavaScript files in an HTML document. It includes importing Google Icons, Materialize CSS, and the JavaScript at the end of the body for optimized loading. ```html
``` -------------------------------- ### HTML Setup for Materialize Source: https://github.com/materializecss/materialize-docs/blob/main/docs/getting-started.html Example of how to link Materialize CSS and JavaScript files in an HTML document. It includes importing Google Icons, Materialize CSS, and the JavaScript at the end of the body for optimized loading. ```html ``` -------------------------------- ### Development Setup and Run Source: https://github.com/materializecss/materialize-docs/blob/main/README.md Clones the repository, initializes submodules, installs dependencies using pnpm, and starts the development server for live preview. ```bash git clone https://github.com/materializecss/materialize-docs.git cd materialize-docs git submodule init git submodule update pnpm install pnpm dev ``` -------------------------------- ### CDN Setup Source: https://github.com/materializecss/materialize-docs/blob/main/src/getting-started.html Includes the Materialize CSS and JavaScript files from a CDN. This is a quick way to get started without downloading the files. ```html ``` -------------------------------- ### Install Materialize with Yarn Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html Installs the latest release of Materialize CSS using Yarn. This includes source files and compiled CSS/JavaScript. ```bash yarn add @materializecss/materialize ``` -------------------------------- ### Install Materialize with Yarn Source: https://github.com/materializecss/materialize-docs/blob/main/docs/getting-started.html Installs the latest release of Materialize CSS using Yarn. This includes source files and compiled CSS/JavaScript. ```bash yarn add @materializecss/materialize ``` -------------------------------- ### Install Materialize with NPM Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html Installs the latest release of Materialize CSS using the Node Package Manager (NPM). This includes source files and compiled CSS/JavaScript. ```bash npm install @materializecss/materialize ``` -------------------------------- ### Install Materialize with NPM Source: https://github.com/materializecss/materialize-docs/blob/main/docs/getting-started.html Installs the latest release of Materialize CSS using the Node Package Manager (NPM). This includes source files and compiled CSS/JavaScript. ```bash npm install @materializecss/materialize ``` -------------------------------- ### CDN Integration for Materialize CSS Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html This snippet shows how to include the Materialize CSS framework in your HTML document using a CDN. It includes both the minified CSS and JavaScript files for quick setup. ```html ``` -------------------------------- ### CDN Integration for Materialize CSS Source: https://github.com/materializecss/materialize-docs/blob/main/docs/getting-started.html This snippet shows how to include the Materialize CSS framework in your HTML document using a CDN. It includes both the minified CSS and JavaScript files for quick setup. ```html ``` -------------------------------- ### Yarn Installation Source: https://github.com/materializecss/materialize-docs/blob/main/src/getting-started.html Installs the latest release of Materialize CSS using Yarn, a popular package manager. ```bash yarn add @materializecss/materialize ``` -------------------------------- ### NPM Installation Source: https://github.com/materializecss/materialize-docs/blob/main/src/getting-started.html Installs the latest release of Materialize CSS using NPM, which includes source files as well as compiled CSS and JavaScript. ```bash npm install @materializecss/materialize ``` -------------------------------- ### Sass Compilation Structure Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html Illustrates the project structure when using the Sass version of Materialize. It shows the location of the main SCSS file and its components, emphasizing that Sass files need to be compiled into CSS. ```bash MyWebsite/ |--css/ | |--materialize.css <-- compiled from scss/materialize.scss | |--js/ | |--materialize.js | |--scss/ | |--materialize.scss | |--components/ | |--index.html ``` -------------------------------- ### Sass Compilation Structure Source: https://github.com/materializecss/materialize-docs/blob/main/docs/getting-started.html Illustrates the project structure when using the Sass version of Materialize. It shows the location of the main SCSS file and its components, emphasizing that Sass files need to be compiled into CSS. ```bash MyWebsite/ |--css/ | |--materialize.css <-- compiled from scss/materialize.scss | |--js/ | |--materialize.js | |--scss/ | |--materialize.scss | |--components/ | |--index.html ``` -------------------------------- ### Theme Initialization Script Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html This JavaScript code snippet checks for a 'theme' preference in local storage and applies it to the document's root element. This is useful for implementing dark mode or other theme functionalities. ```javascript const theme = localStorage.getItem("theme"); if (theme) document.documentElement.setAttribute("theme", theme); ``` -------------------------------- ### Theme Initialization Script Source: https://github.com/materializecss/materialize-docs/blob/main/docs/getting-started.html This JavaScript code snippet checks for a 'theme' preference in local storage and applies it to the document's root element. This is useful for implementing dark mode or other theme functionalities. ```javascript const theme = localStorage.getItem("theme"); if (theme) document.documentElement.setAttribute("theme", theme); ``` -------------------------------- ### Materialize Initialization Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/templates/parallax-template/preview.html Initializes all Materialize components on the page. This is a common setup step for Materialize projects. ```JavaScript M.AutoInit(); ``` -------------------------------- ### Materialize Initialization Source: https://github.com/materializecss/materialize-docs/blob/main/src/public/templates/parallax-template/preview.html Initializes all Materialize components on the page. This is a common setup step for Materialize projects. ```JavaScript M.AutoInit(); ``` -------------------------------- ### Materialize Initialization Source: https://github.com/materializecss/materialize-docs/blob/main/src/public/templates/parallax-template/index.html Initializes all Materialize components on the page. This is a common setup step for Materialize projects. ```JavaScript M.AutoInit(); ``` -------------------------------- ### Materialize Initialization Source: https://github.com/materializecss/materialize-docs/blob/main/docs/templates/parallax-template/preview.html Initializes all Materialize components on the page. This is a common setup step for Materialize projects. ```JavaScript M.AutoInit(); ``` -------------------------------- ### Materialize Initialization Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/templates/parallax-template/index.html Initializes all Materialize components on the page. This is a common setup step for Materialize projects. ```JavaScript M.AutoInit(); ``` -------------------------------- ### Materialize Initialization Source: https://github.com/materializecss/materialize-docs/blob/main/docs/templates/parallax-template/index.html Initializes all Materialize components on the page. This is a common setup step for Materialize projects. ```JavaScript M.AutoInit(); ``` -------------------------------- ### Build and Preview Site Source: https://github.com/materializecss/materialize-docs/blob/main/README.md Builds the static site for production and starts a local server to preview the built site. ```bash pnpm build pnpm preview ``` -------------------------------- ### Materialize CSS AutoInit Options Reference Source: https://github.com/materializecss/materialize-docs/blob/main/src/auto-init.html Provides details on the options available for the M.AutoInit() function, including the context element for searching components and a general options object for component-specific configurations. ```APIDOC M.AutoInit(context?: Element, options?: Object) Parameters: context: DOM Element to search within for components. Defaults to document.body. options: Object containing options for each component. Refer to individual component documentation for specific option details. Description: Initializes all Materialize components within the specified DOM context. The options object allows for customization of individual component behaviors during initialization. ``` -------------------------------- ### Getting Timepicker Instance Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/timepicker.html Example of how to retrieve the plugin instance for a given element to call its methods. ```javascript const instance = M.Timepicker.getInstance(elem); ``` -------------------------------- ### Getting Timepicker Instance Source: https://github.com/materializecss/materialize-docs/blob/main/docs/timepicker.html Example of how to retrieve the plugin instance for a given element to call its methods. ```javascript const instance = M.Timepicker.getInstance(elem); ``` -------------------------------- ### Roboto Font Import Source: https://github.com/materializecss/materialize-docs/blob/main/docs/version/v2.2.2/getting-started.html This CSS snippet imports the Roboto font from Google Fonts, which is a common requirement for Materialize CSS to ensure consistent typography. ```css @import url("https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900,900i"); ``` -------------------------------- ### Materialize CSS Setup and Theme Source: https://github.com/materializecss/materialize-docs/blob/main/docs/pushpin-demo.html This snippet demonstrates how to import Materialize CSS styles from Google Fonts and how to apply a theme based on local storage settings. ```htmls12
s12 m4
s12 m4
s12 m4
s12 m6 l3
s12 m6 l3
s12 m6 l3
s12 m6 l3
Test 1
Test 2
Test 3
Test 4
Test 5
Test 1
Test 2
Test 3
Test 4
Test 5
Card Title
I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.
Card Title
I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.