### Install Pico.css with Composer Source: https://github.com/picocss/pico/blob/main/README.md Install Pico.css using Composer for PHP projects. ```shell composer require picocss/pico ``` -------------------------------- ### Install Pico.css with Yarn Source: https://github.com/picocss/pico/blob/main/README.md Install Pico.css using Yarn for project integration. ```shell yarn add @picocss/pico ``` -------------------------------- ### Install Pico.css with NPM Source: https://github.com/picocss/pico/blob/main/README.md Install Pico.css using NPM for project integration. ```shell npm install @picocss/pico ``` -------------------------------- ### File Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A file input field with custom styling for the file selector button. ```html ``` -------------------------------- ### Month Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A month input field for selecting a month and year. ```html ``` -------------------------------- ### Fluid Classless Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Configure a fluid, classless Pico.css setup, disabling utility classes and viewport scaling. ```scss @use "pico" with ( $enable-classes: false, $enable-semantic-container: true, $enable-viewport: false ); ``` -------------------------------- ### Radio Button Styling Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A basic example demonstrating radio button styling within a form. Ensure radio buttons in a group share the same 'name' attribute. ```html
Gender
``` -------------------------------- ### Autoprefixing CSS Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Demonstrates how autoprefixer adds vendor prefixes to CSS properties for broader browser compatibility. ```css /* Before */ user-select: none; /* After (with autoprefixer) */ -webkit-user-select: none; -moz-user-select: none; user-select: none; ``` -------------------------------- ### URL Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md An input field for URLs, with HTML5 validation for correct URL format. ```html ``` -------------------------------- ### Basic Textarea Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A multi-line text input area with adjustable height and styling for border, padding, and focus. ```html ``` -------------------------------- ### HTML for Tooltip Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md This example shows how to implement tooltips using the `data-tooltip` attribute on elements like buttons and links. The tooltip content is defined directly in the attribute. ```html ? ``` -------------------------------- ### Lazy Load Theme Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Dynamically loads the appropriate theme (light or dark) based on user's system preference. ```javascript const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = `/css/pico.${theme}.min.css`; document.head.appendChild(link); ``` -------------------------------- ### Week Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A week input field for selecting a specific week of the year. ```html ``` -------------------------------- ### Password Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A password input field that masks character input for security. ```html ``` -------------------------------- ### Text Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A standard text input field for user entry. Styled with border, padding, and focus ring. ```html ``` -------------------------------- ### Color Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A color picker input that utilizes the native browser color selection UI. ```html ``` -------------------------------- ### Time Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A time input field that uses the native browser time selection UI. ```html ``` -------------------------------- ### Scoped CSS Integration Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Demonstrates how to use Pico.css with a parent selector for scoped styling. Elements inside the '.pico' div are styled, while those outside are not. ```html
``` -------------------------------- ### Custom Breakpoints Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Example of how to customize specific breakpoints by deep-merging with the default settings. Only the specified breakpoint is modified. ```scss @use "pico" with ( $breakpoints: ( sm: ( breakpoint: 640px, viewport: 600px, root-font-size: 110%, ), ), ); ``` -------------------------------- ### Number Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A number input field with min, max, and step attributes, featuring increment/decrement buttons. ```html ``` -------------------------------- ### Card Component Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Example of a card component using the `
` element. Pico.css provides a subtle border, shadow, padding, and spacing, suitable for card layouts. ```html

Card title

Card content

``` -------------------------------- ### DateTime-Local Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A datetime-local input field for selecting both date and time without timezone information. ```html ``` -------------------------------- ### Date Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A date input field that uses the native browser date picker interface. ```html ``` -------------------------------- ### Search Input Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md A search input example styled with Pico.css, including a search icon on the left and validation icons when `aria-invalid` is set. ```html ``` -------------------------------- ### CSS Minification Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Shows the effect of CSS minification, which removes whitespace and comments to reduce file size. ```css /* Before */ button { padding: 0.375rem 0.75rem; border: 1px solid var(--pico-primary-border); border-radius: var(--pico-border-radius); } /* After */ button{padding:.375rem .75rem;border:1px solid var(--pico-primary-border);border-radius:var(--pico-border-radius)} ``` -------------------------------- ### Telephone Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A telephone input field that triggers a numeric keyboard on mobile devices. ```html ``` -------------------------------- ### Loading State Indicator Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Examples of a loading state indicator using `[aria-busy="true"]`. Pico.css provides a spinner animation overlay, disabled cursor, and opacity adjustment. ```html
``` -------------------------------- ### Single Select Dropdown Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A dropdown select element for choosing a single option from a list, with default placeholder text. ```html ``` -------------------------------- ### Visual Regression Test with Cypress Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Write visual regression tests using Cypress to ensure custom themes render correctly. This example checks if buttons have the expected background color after applying a custom theme. ```javascript // With Cypress or Playwright describe('Pico Custom Theme', () => { it('renders buttons with custom color', () => { cy.get('button').should('have.css', 'background-color', 'rgb(0, 102, 204)'); }); }); ``` -------------------------------- ### Responsive Embedded Media Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Shows examples of responsive images, videos, and iframes. Images scale to 100% width, while videos and canvases maintain aspect ratio. ```html Description ``` -------------------------------- ### Range Slider Input Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Example of a range slider input with track and thumb styling, color-coded fill, and accessible focus states provided by Pico.css. ```html ``` -------------------------------- ### Color Picker Input Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Example of a color picker input with a default value. Pico.css applies custom border and focus styles to the native browser color picker. ```html ``` -------------------------------- ### Custom Brand Colors with SCSS Source: https://github.com/picocss/pico/blob/main/_autodocs/README.md Customize the primary theme color using SCSS variables or CSS custom properties. This example demonstrates setting a 'pink' theme. ```scss @use "pico" with ( $theme-color: "pink", ); // Or at runtime: :root { --pico-primary: #your-color; } ``` -------------------------------- ### Starter HTML Template with Pico.css Source: https://github.com/picocss/pico/blob/main/README.md A basic HTML template demonstrating the integration of Pico.css. ```html Hello world!

Hello world!

``` -------------------------------- ### Starter HTML Template with Pico.css Classless Source: https://github.com/picocss/pico/blob/main/README.md A basic HTML template using the class-less version of Pico.css for pure semantic HTML styling. ```html Hello, world!

Hello, world!

``` -------------------------------- ### Minimal Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Create a minimal Pico.css build by disabling classes, transitions, and specific modules. This is useful for highly customized projects. ```scss @use "pico" with ( $enable-classes: false, $enable-transitions: false, $enable-important: false, $modules: ( "layout/grid": false, "components/dropdown": false, "components/modal": false, "components/tooltip": false ) ); ``` -------------------------------- ### Run Complete Build Pipeline Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Executes the full build process including linting, SCSS compilation, theme generation, autoprefixing, and minification. Use this for a complete production build. ```bash npm run build ``` -------------------------------- ### Textarea with Validation Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A textarea with a maximum character limit and an aria-invalid attribute for validation state. ```html ``` -------------------------------- ### Traditional Framework Style with Classes Source: https://github.com/picocss/pico/blob/main/_autodocs/README.md Use this approach when you need to apply specific classes for styling. Include `pico.min.css` or use custom SCSS with `$enable-classes: true`. ```html
Card 1
Card 2
``` -------------------------------- ### Hidden Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md A hidden input field used for submitting meta-data that is not visible to the user. ```html ``` -------------------------------- ### Build Single Theme with Custom Color and Typography Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Create a custom SCSS file to build Pico.css with a specific theme color and disable responsive typography. ```scss @use "pico" with ( $theme-color: "pink", $enable-responsive-typography: false ); ``` -------------------------------- ### Enable Dark Mode with System Preference Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Link Pico.min.css to automatically enable dark mode based on the user's system preference (prefers-color-scheme). ```html ``` -------------------------------- ### Import Pico.css in Astro Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Import Pico.css directly within the frontmatter of an Astro component for global styling. ```astro --- import '@picocss/pico'; --- My Astro Site

Astro + Pico

``` -------------------------------- ### Hidden Label Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md Demonstrates a hidden label associated with an input field, ensuring accessibility for screen readers. ```html ``` -------------------------------- ### Import Pico.css in SCSS Source: https://github.com/picocss/pico/blob/main/README.md Import Pico.css into your SCSS file using the @use directive. ```scss @use "pico"; ``` -------------------------------- ### Link Pico.css from CDN Source: https://github.com/picocss/pico/blob/main/README.md Use this CDN link to include Pico.css in your project. ```html ``` -------------------------------- ### Run All Linting Tasks Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Executes all defined linting tasks, including formatting with Prettier and sorting CSS properties. ```bash npm run lint ``` -------------------------------- ### Import Pico.css in Next.js Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Import Pico.css in your Next.js application's `_app.jsx` file for global styling. ```jsx // pages/_app.jsx import '@picocss/pico'; export default function App({ Component, pageProps }) { return } ``` -------------------------------- ### Package.json Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Defines project metadata, entry points, and browser support for the Pico.css npm package. ```json { "name": "@picocss/pico", "version": "2.1.1", "main": "css/pico.min.css", "browserslist": ["defaults"] } ``` -------------------------------- ### Minimal Markup (Classless) Source: https://github.com/picocss/pico/blob/main/_autodocs/README.md This method uses semantic HTML elements without classes for styling. Use `pico.classless.min.css` or `pico.fluid.classless.min.css`. ```html
Card 1
Card 2
``` -------------------------------- ### Email Input Example Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md An email input field with built-in HTML5 validation. Displays an invalid state via [aria-invalid]. ```html ``` -------------------------------- ### Link Pico.css Manually Source: https://github.com/picocss/pico/blob/main/README.md Include this line in the of your HTML to use Pico.css. ```html ``` -------------------------------- ### Classless Version Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Enable the classless version of Pico.css, disabling utility classes. Also enables semantic containers. ```scss @use "pico" with ( $enable-classes: false, $enable-semantic-container: true ); ``` -------------------------------- ### Custom Form Element Spacing Source: https://github.com/picocss/pico/blob/main/_autodocs/Form-Elements.md Example of overriding the default vertical and horizontal spacing for form elements using CSS variables. ```css :root { --pico-form-element-spacing-horizontal: 1rem; --pico-form-element-spacing-vertical: 0.75rem; } ``` -------------------------------- ### Multi-Theme Support with Conditional CSS Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Apply different themes (e.g., Azure, Blue) by including specific conditional CSS files and using Pico's theme classes. Custom overrides can be applied via inline styles or separate CSS. ```html
``` -------------------------------- ### Configure Browserslist for Wider Support Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Configure browserslist for wider browser support, including older versions and less common browsers. This requires rebuilding with autoprefixer. ```json { "browserslist": ["> 0.5%, last 2 versions, not dead"] } ``` -------------------------------- ### Minimal Pico.css Build with SCSS Modules Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Reduce the CSS bundle size by selectively enabling only the necessary Pico.css modules in your SCSS configuration. ```scss @use "pico" with ( $modules: ( // Keep only what you need "layout/document": true, "layout/landmarks": true, "layout/container": true, "content/typography": true, "content/link": true, "content/button": true, "forms/basics": true, // Disable everything else "layout/grid": false, "components/accordion": false, "components/dropdown": false, "components/modal": false, "components/tooltip": false, "components/loading": false, "components/nav": false, "components/progress": false, "components/card": false, "components/group": false, "forms/checkbox-radio-switch": false, "forms/input-range": false, "forms/input-color": false, "forms/input-date": false, "forms/input-file": false, "forms/input-search": false, ) ); ``` -------------------------------- ### CSS Variable Inheritance Example Source: https://github.com/picocss/pico/blob/main/_autodocs/CSS-Variables-Reference.md Demonstrates how CSS variables cascade. A global override sets a default, while a specific class can override it for elements within that class. ```css /* Global override */ :root { --pico-primary: blue; } /* Section-specific override */ .special-section { --pico-primary: red; } /* All pico components in .special-section will use red as primary */ ``` -------------------------------- ### Pico.css File Organization Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Overview of the Pico.css project directory structure, detailing the location of compiled CSS, source SCSS files, scripts, and configuration. ```text pico/ ├── css/ # Compiled, ready-to-use CSS │ ├── pico.min.css # Default (azure, standard) │ ├── pico.blue.min.css # Blue theme, standard │ ├── pico.classless.min.css # Default (azure, classless) │ ├── pico.classless.blue.min.css │ ├── pico.fluid.classless.*.min.css │ ├── pico.conditional.*.min.css │ └── ... (114 total files) │ ├── scss/ # Source SCSS │ ├── _index.scss # Main entry point (forwards all modules) │ ├── _settings.scss # Configuration variables │ ├── pico.scss # Distribution entry (default) │ ├── pico.classless.scss # Classless distribution │ ├── pico.fluid.classless.scss │ ├── pico.conditional.scss │ ├── colors/ # Color definitions │ ├── components/ # Component SCSS files │ ├── content/ # Content element SCSS │ ├── forms/ # Form element SCSS │ ├── layout/ # Layout SCSS │ ├── helpers/ # Helper functions │ ├── utilities/ # Utility SCSS │ └── themes/ # Theme definitions │ ├── scripts/ │ └── build-themes.js # Theme generation script │ ├── package.json # NPM configuration and scripts └── .pico/ # Temporary build artifacts (gitignored) ``` -------------------------------- ### Build Themes Script Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md JavaScript configuration for the `build-themes` script, defining theme colors and stylesheet versions to be generated. ```javascript const themeColors = [ "amber", "blue", "cyan", "fuchsia", "green", "grey", "indigo", "jade", "lime", "orange", "pink", "pumpkin", "purple", "red", "sand", "slate", "violet", "yellow", "zinc" ]; const versions = [ { name: "pico", ... }, { name: "pico.classless", ... }, { name: "pico.fluid.classless", ... }, { name: "pico.conditional", ... }, { name: "pico.classless.conditional", ... }, { name: "pico.fluid.classless.conditional", ... } ]; ``` -------------------------------- ### Pico.css NPM Scripts Source: https://github.com/picocss/pico/blob/main/_autodocs/README.md This snippet lists the available NPM scripts for building, developing, and maintaining Pico.css. These scripts automate tasks like SCSS compilation, theme generation, and code linting. ```text npm run build npm run dev npm run build:css npm run build:themes npm run lint npm run build:autoprefix npm run build:minify ``` -------------------------------- ### Migrate from Bootstrap to Pico Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Convert HTML structure and classes from Bootstrap to Pico. Pico often requires fewer or no utility classes for basic elements like buttons and layout containers. ```html
Column
Column
``` -------------------------------- ### Pico.css File Structure Source: https://github.com/picocss/pico/blob/main/_autodocs/README.md This snippet outlines the directory structure of the Pico.css project, detailing the organization of SCSS source files, compiled CSS, build scripts, and configuration. ```text pico/ ├── scss/ # SCSS source code │ ├── _index.scss # Main entry point │ ├── _settings.scss # Configuration variables │ ├── colors/ # Color definitions (19 families) │ ├── components/ # Interactive components (9 modules) │ ├── content/ # Content elements (8 modules) │ ├── forms/ # Form elements (7 modules) │ ├── layout/ # Layout components (6 modules) │ ├── helpers/ # SCSS functions │ ├── utilities/ # Utility classes (2 modules) │ └── themes/ # Theme definitions │ ├── css/ # Compiled CSS (ready to use) │ ├── pico.min.css # Default theme │ ├── pico.blue.min.css # Blue theme │ └── ... (114 files total) │ ├── scripts/ │ └── build-themes.js # Generates CSS for all theme/variant combinations │ └── package.json # NPM configuration ``` -------------------------------- ### Generated CSS Variables for Primary Theme Color Source: https://github.com/picocss/pico/blob/main/_autodocs/Theme-Colors.md Example of CSS variables generated when the primary theme color is set to 'blue'. These variables control the styling of primary elements. ```css --pico-primary: #2060df (blue-550) --pico-primary-background: #e0e1fa (blue-100) --pico-primary-border: #e0e1fa (blue-100) --pico-primary-underline: #3c71f7 (blue-500) --pico-primary-hover: #1d59d0 (blue-600) --pico-primary-hover-background: #c0d2fa (blue-150) --pico-primary-hover-border: #c0d2fa (blue-150) --pico-primary-hover-underline: #1d59d0 (blue-600) --pico-primary-focus: #748bf8 (blue-400) --pico-primary-inverse: #fff (white or dark gray in dark mode) ``` -------------------------------- ### Select Pico CSS Theme Color via SCSS Source: https://github.com/picocss/pico/blob/main/_autodocs/README.md Choose from 19 pre-designed color themes by setting the $theme-color variable during Pico CSS SCSS import. ```scss @use "pico" with ( $theme-color: "green" // or: blue, red, pink, etc. ); ``` -------------------------------- ### Set CSS Variable Prefix Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Defines the prefix for all generated CSS custom properties. This ensures Pico CSS can coexist with other CSS frameworks by avoiding naming conflicts. The prefix must start with '--'. ```scss $css-var-prefix: "--pico-" !default; ``` -------------------------------- ### Including Pico.css Themes via CDN Source: https://github.com/picocss/pico/blob/main/_autodocs/Theme-Colors.md Link to different Pico.css theme variations directly from a CDN. Multiple themes like 'blue', 'green', and 'red' are available. ```html ``` -------------------------------- ### Standard Pico.css SCSS Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md SCSS configuration for the standard Pico.css stylesheet, enabling classes, responsive typography, and a viewport constraint. Use this for traditional class-based layouts. ```scss @use "../scss" with ( $theme-color: "azure" ); ``` -------------------------------- ### Integrate Pico with Bootstrap Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Use Pico.css alongside Bootstrap by including both stylesheets and scoping Pico styles within a specific container to prevent conflicts. ```html
``` -------------------------------- ### Link Pico.css Fluid Classless Version Source: https://github.com/picocss/pico/blob/main/README.md Use this CDN link for the fluid class-less version of Pico.css, providing fluid containers. ```html ``` -------------------------------- ### HTML for Accessibility Utilities Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md This code demonstrates accessibility utilities, including a 'skip to main content' link that is visible on focus and a button that shows an accessible focus outline. ```html Skip to main ``` -------------------------------- ### Custom SCSS with Pico in Next.js Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Integrate custom SCSS with Pico.css in Next.js by creating a SCSS file and importing it into `_app.jsx`. ```scss // styles/pico.scss @use '@picocss/pico' with ( $theme-color: 'green' ); // Import in _app.jsx import './styles/pico.scss'; ``` -------------------------------- ### Link Pico.css Classless Version Source: https://github.com/picocss/pico/blob/main/README.md Use this CDN link for the class-less version of Pico.css, providing centered viewports. ```html ``` -------------------------------- ### Fluid Classless SCSS Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Configures Pico.css for fluid, classless layouts with a specific theme and semantic containers enabled. Viewport constraints are disabled for full-width designs. ```scss @use "../scss" with ( $theme-color: "azure", $enable-semantic-container: true, $enable-viewport: false, $enable-classes: false ); ``` -------------------------------- ### Classless Pico.css SCSS Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md SCSS configuration for the classless variant of Pico.css, disabling explicit classes and enabling semantic containers. Ideal for minimal HTML markup relying on semantic elements. ```scss @use "../scss" with ( $theme-color: "azure", $enable-semantic-container: true, $enable-classes: false ); ``` -------------------------------- ### Format SCSS with Prettier Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Formats the SCSS files according to Prettier's code style rules. ```bash npm run lint:prettier ``` -------------------------------- ### Date and Time Picker Inputs Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Demonstrates native browser date, time, month, and week picker inputs styled by Pico.css. These inputs utilize custom styling for their respective picker interfaces. ```html ``` -------------------------------- ### Custom Breakpoints Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Define custom breakpoints for responsive design in Pico.css. This allows for fine-grained control over responsive behavior. ```scss @use "pico" with ( $breakpoints: ( sm: ( breakpoint: 640px, viewport: 600px, root-font-size: 110% ), lg: ( breakpoint: 1200px, viewport: 1100px, root-font-size: 120% ) ) ); ``` -------------------------------- ### Basic Form Structure with Fieldset Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Illustrates a basic form layout using `
` and ``, including text and email input fields with labels. Supports consistent styling, focus states, and validation attributes. ```html
Form Section
``` -------------------------------- ### Configure Browserslist for Modern Browsers Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Define modern browser support using a 'defaults' query in browserslist. This configuration targets widely used, up-to-date browsers. ```json { "browserslist": ["defaults"] } ``` -------------------------------- ### Apply Autoprefixer Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Adds vendor prefixes to CSS rules for cross-browser compatibility, based on the `browserslist` configuration. It targets all non-minified CSS files in the `css/` directory. ```bash postcss --config css --replace css/*.css !css/*.min.css ``` -------------------------------- ### Button Variants and Link as Button Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Demonstrates different color variants for buttons and how to style an anchor tag to look like a button. Supports disabled states and hover effects. ```html Link as button ``` -------------------------------- ### Create a Minimal Pico Theme by Disabling Modules Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Reduce the size of the Pico CSS by disabling non-essential modules in the SCSS configuration. This is useful for projects that only need a subset of Pico's features. ```scss // minimal-theme.scss @use "pico" with ( // Disable unnecessary modules $modules: ( // Only keep essentials "layout/document": true, "layout/landmarks": true, "layout/container": true, "content/typography": true, "content/link": true, "content/button": true, "forms/basics": true, "forms/checkbox-radio-switch": true, // Disable "components/dropdown": false, "components/tooltip": false, "components/modal": false, "forms/input-range": false, "forms/input-color": false, ), ); ``` -------------------------------- ### Default Module Toggles Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Initializes the $modules variable with all Pico.css modules set to true, enabling all styles by default. This map can be modified to disable specific modules. ```scss $modules: () !default; $modules: map.merge( ( "themes/default": true, "layout/document": true, "layout/landmarks": true, "layout/container": true, "layout/section": true, "layout/grid": true, "layout/overflow-auto": true, "content/link": true, "content/typography": true, "content/embedded": true, "content/button": true, "content/table": true, "content/code": true, "content/figure": true, "content/misc": true, "forms/basics": true, "forms/checkbox-radio-switch": true, "forms/input-color": true, "forms/input-date": true, "forms/input-file": true, "forms/input-range": true, "forms/input-search": true, "components/accordion": true, "components/card": true, "components/dropdown": true, "components/group": true, "components/loading": true, "components/modal": true, "components/nav": true, "components/progress": true, "components/tooltip": true, "utilities/accessibility": true, "utilities/reduce-motion": true ), $modules ); ``` -------------------------------- ### Default Breakpoints Configuration Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Defines the default breakpoints used for responsive design in Pico.css. These can be extended or overridden. ```scss $breakpoints: () !default; $breakpoints: map.deep-merge( ( sm: ( breakpoint: 576px, viewport: 510px, root-font-size: 106.25%, ), md: ( breakpoint: 768px, viewport: 700px, root-font-size: 112.5%, ), lg: ( breakpoint: 1024px, viewport: 950px, root-font-size: 118.75%, ), xl: ( breakpoint: 1280px, viewport: 1200px, root-font-size: 125%, ), xxl: ( breakpoint: 1536px, viewport: 1450px, root-font-size: 131.25%, ) ), $breakpoints ); ``` -------------------------------- ### Compiling Custom SCSS Theme Source: https://github.com/picocss/pico/blob/main/_autodocs/Theme-Colors.md Compile a custom SCSS file that overrides Pico.css theme variables into a CSS file using the Sass compiler. ```bash sass custom-theme.scss custom-theme.css ``` -------------------------------- ### Enable Viewport Constraints Source: https://github.com/picocss/pico/blob/main/_autodocs/SCSS-Configuration.md Controls whether semantic containers have a max-width constraint and are centered. Enabling this (true) applies constraints; disabling it (false) results in a fluid, full-width layout. ```scss $enable-viewport: true !default; ``` -------------------------------- ### Enable Source Maps for Debugging Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Command to enable source maps during development builds for easier debugging of compiled CSS. ```bash sass --style expanded scss/:css/ # Adds source maps for debugging ``` -------------------------------- ### Code Block and Inline Code Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Illustrates styling for code blocks using `
` and inline code snippets using ``. Features a distinctive background and monospace font.

```html
function example() {
  return "code";
}

Use Ctrl+C to copy.

``` -------------------------------- ### Import Pico.css in Svelte Source: https://github.com/picocss/pico/blob/main/_autodocs/Customization-Guide.md Import Pico.css globally within a Svelte component's script tag or in a global style block. ```svelte

Svelte + Pico

``` -------------------------------- ### Grid Component Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md Implement a CSS Grid-based layout system using the .grid class. Child elements like
will automatically arrange into columns. ```html
Column 1
Column 2
Column 3
``` -------------------------------- ### Spacing and Sizing Variables Source: https://github.com/picocss/pico/blob/main/_autodocs/CSS-Variables-Reference.md Defines core spacing and sizing variables for Pico CSS, including base spacing, line height, border radius, border width, and outline width. ```css --pico-spacing: /* 1rem (16px) default, scales at breakpoints if responsive-spacings enabled */ --pico-line-height: /* 1.5 */ --pico-border-radius: /* 0.25rem (4px) */ --pico-border-width: /* 1px */ --pico-outline-width: /* 3px */ ``` -------------------------------- ### Build with Disabled Modules Source: https://github.com/picocss/pico/blob/main/_autodocs/Build-System.md Customize the build by disabling specific modules like tooltips, dropdowns, and input ranges. ```scss @use "pico" with ( $theme-color: "blue", $modules: ( "components/tooltip": false, "components/dropdown": false, "forms/input-range": false, ) ); ``` -------------------------------- ### HTML for Progress Bar Source: https://github.com/picocss/pico/blob/main/_autodocs/Components.md This snippet illustrates a progress bar component using the native `` element. It includes an associated `