Skip to content

Getting started

Conditional styling

Apply Pico CSS styles selectively by wrapping elements in a .pico container, ideal for mixed-style environments.

Pico offers a .conditional version that restricts styling to elements within .pico class containers.

The remaining minimal :root reset ensures typography consistency across your entire site.

See the version picker to easily select the ideal Pico CSS version variant to match your project's needs.

Install manually#

Download Pico and link /css/pico.conditional.min.css in the <head> of your website.

<link rel="stylesheet" href="css/pico.conditional.min.css">

Usage from CDN#

Alternatively, you can use jsDelivr CDN to linkpico.conditional.min.css.

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.conditional.min.css">

Usage with Sass#

@use "pico" with (
  $parent-selector: ".pico"
);

Starter HTML template#

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="color-scheme" content="light dark" />
    <link rel="stylesheet" href="css/pico.conditional.min.css">
    <title>Hello world!</title>
  </head>
  <body>
    <main>
      <section>
        <p>Unstyled hello world!</p>
      </section>
      <section class="pico">
        <p>Styled hello world!</p>
      </section>
    </main>
  </body>
</html>

Examples#

Example with Pico styles:

<form class="pico">
  <input type="text" name="text" placeholder="Text" aria-label="Text" />
</form>

Example without Pico styles:

<form>
  <input type="text" name="text" placeholder="Text" aria-label="Text" />
</form>

Demo#

Edit this page on GitHub