mirror of
https://github.com/picocss/pico.git
synced 2025-04-24 18:26:14 -04:00
Improvements
- Edit code colors and add a color for comments - Add ::selection - Small edits for cards: last-child and overflow - Add card-sectioning (header, footer, pre) - Change global hue for Primary color - Remove border for pre - Add querySelectorAll() for theme-switcher.js - Update docs
This commit is contained in:
parent
c3f9d8d8c8
commit
85e21d35de
23 changed files with 937 additions and 422 deletions
|
@ -8,7 +8,7 @@
|
|||
[data-theme="light"],
|
||||
:root:not([data-theme="dark"]) {
|
||||
--nav-background: rgba(255, 255, 255, 0.7);
|
||||
--nav-border: rgba(115, 132, 140, 0.2);
|
||||
--nav-border: rgba(115, 130, 140, 0.2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,8 +17,8 @@
|
|||
*/
|
||||
@media only screen and (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--nav-background: rgba(16, 25, 30, 0.8);
|
||||
--nav-border: rgba(115, 132, 140, 0.2);
|
||||
--nav-background: rgba(16, 24, 30, 0.8);
|
||||
--nav-border: rgba(115, 130, 140, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,8 @@
|
|||
* Enabled if forced with data-theme="dark"
|
||||
*/
|
||||
[data-theme="dark"] {
|
||||
--nav-background: rgba(16, 25, 30, 0.8);
|
||||
--nav-border: rgba(115, 132, 140, 0.2);
|
||||
--nav-background: rgba(16, 24, 30, 0.8);
|
||||
--nav-border: rgba(115, 130, 140, 0.2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,9 +167,10 @@ main > aside details {
|
|||
}
|
||||
|
||||
main > aside details summary {
|
||||
color: var(--h3);
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
text-transform: uppercase;
|
||||
color: var(--h3);
|
||||
}
|
||||
|
||||
main > aside details summary::after {
|
||||
|
@ -370,19 +371,11 @@ a[role=button] {
|
|||
content: 'Bulky';
|
||||
}
|
||||
|
||||
[data-theme="invalid"] pre {
|
||||
border-color: var(--invalid);
|
||||
}
|
||||
|
||||
[data-theme="valid"]:before {
|
||||
background: var(--valid);
|
||||
content: 'Great';
|
||||
}
|
||||
|
||||
[data-theme="valid"] pre {
|
||||
border-color: var(--valid);
|
||||
}
|
||||
|
||||
section[title="love"] [data-theme="invalid"]:before {
|
||||
content: 'Not so great';
|
||||
}
|
||||
|
@ -427,46 +420,6 @@ body > nav ul:first-of-type li:nth-of-type(2) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Docs: Code inside <article>
|
||||
*/
|
||||
article pre {
|
||||
margin-top: 2rem;
|
||||
margin-bottom: -2rem;
|
||||
}
|
||||
|
||||
@media (min-width: 576px) {
|
||||
article pre {
|
||||
padding: 2rem 2.5rem;
|
||||
margin: -2.5rem;
|
||||
margin-top: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
article pre {
|
||||
padding: 2rem 3rem;
|
||||
margin: -3rem;
|
||||
margin-top: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
article pre {
|
||||
padding: 2rem 3.5rem;
|
||||
margin: -3.5rem;
|
||||
margin-top: 3.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
article pre {
|
||||
padding: 2rem 4rem;
|
||||
margin: -4rem;
|
||||
margin-top: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Docs: Theme switcher
|
||||
*/
|
||||
|
|
2
docs/css/pico.docs.min.css
vendored
2
docs/css/pico.docs.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -113,7 +113,7 @@
|
|||
<pre><code><<b>link</b> <i>rel</i>=<u>"stylesheet"</u> <i>href</i>=<u>"css/pico.min.css"</u>></code></pre>
|
||||
<p>Starter template:</p>
|
||||
|
||||
<pre><code><!doctype html>
|
||||
<pre><code><em><!doctype html></em>
|
||||
<<b>html</b> <i>lang</i>=<u>"en"</u>>
|
||||
<<b>head</b>>
|
||||
<<b>meta</b> <i>charset</i>=<u>"utf-8"</u>>
|
||||
|
@ -211,18 +211,18 @@
|
|||
|
||||
<p>SCSS:</p>
|
||||
|
||||
<pre data-theme="generated"><code>// <span class="name">Custom colors</span>
|
||||
<pre><code><em>// <span class="name">Custom colors</em></span>
|
||||
<i>$primary-500</i>: <u class="c500">...</u>;
|
||||
<i>$primary-600</i>: <u class="c600">...</u>;
|
||||
<i>$primary-700</i>: <u class="c700">...</u>;
|
||||
|
||||
// Pico library
|
||||
<em>// Pico library</em>
|
||||
<b>@import</b> <u>"path/pico"</u>;</code></pre>
|
||||
|
||||
<p>CSS:</p>
|
||||
|
||||
<pre data-theme="generated"><code>/* <span class="name"></span>Light theme (Default) */
|
||||
/* Can be forced with data-theme="light" */
|
||||
<pre><code><em>/* <span class="name"></span>Light theme (Default) */
|
||||
/* Can be forced with data-theme="light" */</em>
|
||||
<b>[data-theme=<u>"light"</u>]</b>,
|
||||
<b>:root:not([data-theme=<u>"dark"</u>])</b> {
|
||||
<i>--primary</i>: <u class="c600">...</u>;
|
||||
|
@ -232,8 +232,8 @@
|
|||
}
|
||||
|
||||
|
||||
/* <span class="name"></span>Dark theme (Auto) */
|
||||
/* Automatically enabled if user has Dark mode enabled */
|
||||
<em>/* <span class="name"></span>Dark theme (Auto) */
|
||||
/* Automatically enabled if user has Dark mode enabled */</em>
|
||||
<i>@media</i> only <b>screen</b> and <b>(prefers-color-scheme: <u>dark</u>)</b> {
|
||||
<b>:root:not([data-theme="light"])</b> {
|
||||
<i>--primary</i>: <u class="c600">...</u>;
|
||||
|
@ -243,8 +243,8 @@
|
|||
}
|
||||
|
||||
|
||||
/* <span class="name"></span>Dark theme (Forced) */
|
||||
/* Enabled if forced with data-theme="dark" */
|
||||
<em>/* <span class="name"></span>Dark theme (Forced) */
|
||||
/* Enabled if forced with data-theme="dark" */</em>
|
||||
<b>[data-theme="<u>dark</u>"]</b> {
|
||||
<i>--primary</i>: <u class="c600">...</u>;
|
||||
<i>--primary-hover</i>: <u class="c500">...</u>;
|
||||
|
@ -264,7 +264,6 @@
|
|||
<h3>For wild HTML purists!</h3>
|
||||
</hgroup>
|
||||
<p>Pico provide a <code>.classless</code> version (<a href="https://picocss.com/examples/classless/">Example</a>).</p>
|
||||
<p>Obviously this version do not include <code>.container</code>, <code>.container-fluid</code>, <code>.grid</code>, <code>.secondary</code>, <code>.contrast</code> and <code>.outline</code>.</p>
|
||||
<p>In this version, <code><<b>header</b>></code>, <code><<b>main</b>></code> and <code><<b>footer</b>></code> act as <a href="#containers">containers</a> to define a centered or a fluid viewport.</p>
|
||||
<p><strong>Usage:</strong></p>
|
||||
<p>Use the default <code>.classless</code> version if you need centered viewports:</p>
|
||||
|
@ -656,11 +655,11 @@
|
|||
<pre><code>
|
||||
<<b>form</b>>
|
||||
|
||||
<!-- Grid -->
|
||||
<em><!-- Grid --></em>
|
||||
<<b>section</b> <i>class</i>=<u>"grid"</u>>
|
||||
|
||||
<<b>div</b>>
|
||||
<!-- Markup example 1: input is inside label -->
|
||||
<em><!-- Markup example 1: input is inside label --></em>
|
||||
<<b>label</b> <i>for</i>=<u>"firstname"</u>>
|
||||
First name
|
||||
<<b>input</b> <i>type</i>=<u>"text"</u> <i>id</i>=<u>"firstname"</u> <i>name</i>=<u>"firstname"</u> <i>placeholder</i>=<u>"First name"</u> <i>required</i>>
|
||||
|
@ -676,12 +675,12 @@
|
|||
|
||||
</<b>section</b>>
|
||||
|
||||
<!-- Markup example 2: input is after label -->
|
||||
<em><!-- Markup example 2: input is after label --></em>
|
||||
<<b>label</b> <i>for</i>=<u>"email"</u>>Email address</<b>label</b>>
|
||||
<<b>input</b> <i>type</i>=<u>"email"</u> <i>id</i>=<u>"email"</u> <i>name</i>=<u>"email"</u> <i>placeholder</i>=<u>"Email address"</u> <i>required</i>>
|
||||
<<b>small</b>>We'll never share your email with anyone else.</<b>small</b>>
|
||||
|
||||
<!-- Button -->
|
||||
<em><!-- Button --></em>
|
||||
<<b>button</b> <i>type</i>=<u>"submit"</u>>Submit</<b>button</b>>
|
||||
|
||||
</<b>form</b>></code></pre>
|
||||
|
@ -748,14 +747,14 @@
|
|||
</label>
|
||||
</fieldset>
|
||||
|
||||
<pre><code><!-- Select -->
|
||||
<pre><code><em><!-- Select --></em>
|
||||
<<b>label</b> <i>for</i>=<u>"country"</u>>Country</<b>label</b>>
|
||||
<<b>select</b> <i>id</i>=<u>"country</u>">
|
||||
<<b>option</b> <i>selected</i>>Choose...</<b>option</b>>
|
||||
<<b>option</b>>...</<b>option</b>>
|
||||
</<b>select</b>>
|
||||
|
||||
<!-- Radios -->
|
||||
<em><!-- Radios --></em>
|
||||
<<b>fieldset</b>>
|
||||
<<b>legend</b>>Gender</<b>legend</b>>
|
||||
<<b>label</b> <i>for</i>=<u>"male"</u>>
|
||||
|
@ -772,7 +771,7 @@
|
|||
</<b>label</b>>
|
||||
</<b>fieldset</b>>
|
||||
|
||||
<!-- Checkbox -->
|
||||
<em><!-- Checkbox --></em>
|
||||
<<b>fieldset</b>>
|
||||
<<b>label</b> <i>for</i>=<u>"terms"</u>>
|
||||
<<b>input</b> <i>type</i>=<u>"checkbox"</u> <i>id</i>=<u>"terms"</u> <i>name</i>=<u>"terms"</u>>
|
||||
|
@ -780,7 +779,7 @@
|
|||
</<b>label</b>>
|
||||
</<b>fieldset</b>>
|
||||
|
||||
<!-- Switch -->
|
||||
<em><!-- Switch --></em>
|
||||
<<b>fieldset</b>>
|
||||
<<b>label</b> <i>for</i>=<u>"switch"</u>>
|
||||
<<b>input</b> <i>type</i>=<u>"checkbox"</u> <i>id</i>=<u>"switch"</u> <i>name</i>=<u>"switch"</u> <i>role</i>=<u>"switch"</u>>
|
||||
|
@ -842,6 +841,27 @@
|
|||
I'm a card!
|
||||
</<b>article</b>></code></pre>
|
||||
|
||||
<p>You can use <code><<b>header</b>></code> and footer <code><<b>footer</b>></code> inside <code><<b>article</b>></code></p>
|
||||
<article>
|
||||
<header>
|
||||
Header
|
||||
</header>
|
||||
Body
|
||||
<footer>
|
||||
Footer
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
<pre><code><<b>article</b>>
|
||||
<<b>header</b>>
|
||||
Header
|
||||
</<b>header</b>>
|
||||
Body
|
||||
<<b>footer</b>>
|
||||
Footer
|
||||
</<b>footer</b>>
|
||||
</<b>article</b>></code></pre>
|
||||
|
||||
</section><!-- ./ Docs: Card -->
|
||||
|
||||
<!-- Docs: Navs -->
|
||||
|
|
2
docs/js/pico.docs.min.js
vendored
2
docs/js/pico.docs.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -19,7 +19,7 @@
|
|||
off: '<i>Turn off dark mode</i>'
|
||||
},
|
||||
target: 'body', // Button append in target
|
||||
selector: 'button.theme-switcher', // Button selector in Dom
|
||||
selector: 'button.theme-switcher', // Button selector in Dom
|
||||
currentTheme: systemColorScheme()
|
||||
};
|
||||
|
||||
|
@ -101,8 +101,11 @@
|
|||
|
||||
// Apply theme
|
||||
document.querySelector('html').setAttribute('data-theme', set);
|
||||
document.querySelector(switcher.selector).innerHTML = label;
|
||||
document.querySelector(switcher.selector).setAttribute('aria-label', stripTags(label));
|
||||
var switchers = document.querySelectorAll(switcher.selector);
|
||||
for (var i = 0; i < switchers.length; i++) {
|
||||
switchers[i].innerHTML = label;
|
||||
switchers[i].setAttribute('aria-label', stripTags(label));
|
||||
}
|
||||
switcher.currentTheme = set;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/**
|
||||
* Docs: Code inside <article>
|
||||
*/
|
||||
|
||||
// Custom spacings
|
||||
article pre {
|
||||
margin-top: $spacing-block;
|
||||
margin-bottom: -$spacing-gutter*2;
|
||||
|
||||
@if map-get($breakpoints, "sm") and
|
||||
map-get($spacing-factor, "sm") {
|
||||
|
||||
@media (min-width: map-get($breakpoints, "sm")) {
|
||||
padding: $spacing-block ($spacing-block*map-get($spacing-factor, "sm"));
|
||||
margin: -$spacing-block*map-get($spacing-factor, "sm");
|
||||
margin-top: $spacing-block*map-get($spacing-factor, "sm");
|
||||
}
|
||||
}
|
||||
|
||||
@if map-get($breakpoints, "md") and
|
||||
map-get($spacing-factor, "md") and
|
||||
$enable-responsive-spacings {
|
||||
|
||||
@media (min-width: map-get($breakpoints, "md")) {
|
||||
padding: $spacing-block ($spacing-block*map-get($spacing-factor, "md"));
|
||||
margin: -$spacing-block*map-get($spacing-factor, "md");
|
||||
margin-top: $spacing-block*map-get($spacing-factor, "md");
|
||||
}
|
||||
}
|
||||
|
||||
@if map-get($breakpoints, "lg") and
|
||||
map-get($spacing-factor, "lg") and
|
||||
$enable-responsive-spacings {
|
||||
|
||||
@media (min-width: map-get($breakpoints, "lg")) {
|
||||
padding: $spacing-block ($spacing-block*map-get($spacing-factor, "lg"));
|
||||
margin: -$spacing-block*map-get($spacing-factor, "lg");
|
||||
margin-top: $spacing-block*map-get($spacing-factor, "lg");
|
||||
}
|
||||
}
|
||||
|
||||
@if map-get($breakpoints, "xl") and
|
||||
map-get($spacing-factor, "xl") and
|
||||
$enable-responsive-spacings {
|
||||
|
||||
@media (min-width: map-get($breakpoints, "xl")) {
|
||||
padding: $spacing-block ($spacing-block*map-get($spacing-factor, "xl"));
|
||||
margin: -$spacing-block*map-get($spacing-factor, "xl");
|
||||
margin-top: $spacing-block*map-get($spacing-factor, "xl");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -83,10 +83,6 @@ pre {
|
|||
background: var(--invalid);
|
||||
content: 'Bulky';
|
||||
}
|
||||
|
||||
pre {
|
||||
border-color: var(--invalid);
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme="valid"] {
|
||||
|
@ -94,10 +90,6 @@ pre {
|
|||
background: var(--valid);
|
||||
content: 'Great';
|
||||
}
|
||||
|
||||
pre {
|
||||
border-color: var(--valid);
|
||||
}
|
||||
}
|
||||
|
||||
section[title="love"] [data-theme="invalid"] {
|
||||
|
|
|
@ -53,9 +53,10 @@ main > aside {
|
|||
border-bottom: none;
|
||||
|
||||
summary {
|
||||
color: var(--h3);
|
||||
font-size: 14px;
|
||||
font-weight: 300;
|
||||
text-transform: uppercase;
|
||||
color: var(--h3);
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
|
|
|
@ -21,5 +21,5 @@
|
|||
|
||||
// Components
|
||||
@import "components/nav";
|
||||
@import "components/card-code";
|
||||
//@import "components/card-code";
|
||||
@import "components/theme-switcher";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue