pico/README.md
2024-01-28 20:14:56 +07:00

6.6 KiB
Raw Blame History

A minimalist and lightweight starter kit that prioritizes semantic syntax, making every HTML element responsive and elegant by default.

Write HTML, Add Pico CSS, and Voilà!

Documentation

Pico.css

Class-light and Semantic
Thriving on simplicity, Pico directly styles your HTML tags, using fewer than 10 `.classes`` overall. It also comes with a class-less version for wild HTML purists.

Great Styles with Just CSS
No extra baggage needed. Pico works seamlessly without dependencies, package managers, external files, or JavaScript, achieving elegant and straightforward styles with pure HTML markup.

Responsive Everything
Effortless elegance on every device. Pico natively scales font sizes and spacings with screen widths, resulting in a consistent and elegant look across devices. No extra classes or configuration needed.

Light or Dark Mode
Pico comes with two accessible, neutral color schemes out of the box: light and dark. The best part? It automatically adapts to users' `prefers-color-scheme``, all without the use of JavaScript.

Easy Customization
Customize Pico with over 130 CSS variables, or dive deeper by using SASS. Switch between 20 handcrafted color themes and compose with 30+ modular components to tailor the UI to your brand's look and feel.

Optimized Performance
Speed meets elegance. Unlike bulky and overcomplicated frameworks that demand extensive class overrides and JavaScript, Pico keeps your HTML lean, decreases memory usage by avoiding excessive CSS specificity, and reduces loaded files.

Table of contents

Quick start

There are 4 ways to get started with pico.css:

Install manually

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

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

Usage from CDN

Alternatively, you can use jsDelivr CDN to link pico.css.

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

Install with NPM

npm install @picocss/pico@next
yarn add @picocss/pico@next

Install with Composer

composer require picocss/pico

Class-less version

Pico provides a .classless version (example).

In this version, header, main and footer act as containers.

Use the default .classless version if you need centered viewports:

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

Or use the .fluid.classless version if you need a fluid container:

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

Then just write pure HTML, and it should look great:

<!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="https://cdn.jsdelivr.net/npm/@picocss/pico@next/css/pico.classless.min.css"
    />
    <title>Hello, world!</title>
  </head>
  <body>
    <main>
      <h1>Hello, world!</h1>
    </main>
  </body>
</html>

Limitations

Pico can be used without custom CSS for quick or small projects. However, its designed as a starting point, like a “reset CSS on steroids”. As Pico does not integrate any helpers or utilities .classes, this minimal CSS framework requires SCSS or CSS knowledge to build large projects.

Documentation

Getting started

Customization

Layout

Content

Forms

Components

About

Browser Support

Pico is designed and tested for the latest stable Chrome, Firefox, Edge, and Safari releases. It does not support any version of IE, including IE 11.

Contributing

If you are interested in contributing to Pico CSS, please read our contributing guidelines.

Copyright and license

Licensed under the MIT License.