mirror of
https://github.com/picocss/pico.git
synced 2025-04-20 16:46:14 -04:00
Improve markup validity
- Use `.classes` instead of properties for validations states - Docs: `aria-label` for `article` + Simplify `hgroup`
This commit is contained in:
parent
ccd29ab40f
commit
b3022b256e
11 changed files with 80 additions and 154 deletions
|
@ -413,12 +413,7 @@ hgroup {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
hgroup h1,
|
hgroup * {
|
||||||
hgroup h2,
|
|
||||||
hgroup h3,
|
|
||||||
hgroup h4,
|
|
||||||
hgroup h5,
|
|
||||||
hgroup h6 {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,31 +660,6 @@ textarea {
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[invalid]:not(:focus), input:not([type="checkbox"]):not([type="radio"])[valid]:not(:focus),
|
|
||||||
select[invalid]:not(:focus),
|
|
||||||
select[valid]:not(:focus),
|
|
||||||
textarea[invalid]:not(:focus),
|
|
||||||
textarea[valid]:not(:focus) {
|
|
||||||
padding-right: 2rem;
|
|
||||||
background-position: center right .75rem;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 1rem auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[invalid]:not(:focus),
|
|
||||||
select[invalid]:not(:focus),
|
|
||||||
textarea[invalid]:not(:focus) {
|
|
||||||
border-bottom: 1px solid var(--invalid);
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b94646' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[valid]:not(:focus),
|
|
||||||
select[valid]:not(:focus),
|
|
||||||
textarea[valid]:not(:focus) {
|
|
||||||
border-bottom: 1px solid var(--valid);
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23288a6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="color"] {
|
input[type="color"] {
|
||||||
height: calc(3rem + 2px);
|
height: calc(3rem + 2px);
|
||||||
}
|
}
|
||||||
|
|
2
css/pico.classless.min.css
vendored
2
css/pico.classless.min.css
vendored
File diff suppressed because one or more lines are too long
37
css/pico.css
37
css/pico.css
|
@ -494,12 +494,7 @@ hgroup {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
hgroup h1,
|
hgroup * {
|
||||||
hgroup h2,
|
|
||||||
hgroup h3,
|
|
||||||
hgroup h4,
|
|
||||||
hgroup h5,
|
|
||||||
hgroup h6 {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -746,31 +741,31 @@ textarea {
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[invalid]:not(:focus), input:not([type="checkbox"]):not([type="radio"])[valid]:not(:focus),
|
input:not([type="checkbox"]):not([type="radio"]).valid, input:not([type="checkbox"]):not([type="radio"]).invalid,
|
||||||
select[invalid]:not(:focus),
|
select.valid,
|
||||||
select[valid]:not(:focus),
|
select.invalid,
|
||||||
textarea[invalid]:not(:focus),
|
textarea.valid,
|
||||||
textarea[valid]:not(:focus) {
|
textarea.invalid {
|
||||||
padding-right: 2rem;
|
padding-right: 2rem;
|
||||||
background-position: center right .75rem;
|
background-position: center right .75rem;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 1rem auto;
|
background-size: 1rem auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[invalid]:not(:focus),
|
input:not([type="checkbox"]):not([type="radio"]).valid,
|
||||||
select[invalid]:not(:focus),
|
select.valid,
|
||||||
textarea[invalid]:not(:focus) {
|
textarea.valid {
|
||||||
border-bottom: 1px solid var(--invalid);
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b94646' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[valid]:not(:focus),
|
|
||||||
select[valid]:not(:focus),
|
|
||||||
textarea[valid]:not(:focus) {
|
|
||||||
border-bottom: 1px solid var(--valid);
|
border-bottom: 1px solid var(--valid);
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23288a6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23288a6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input:not([type="checkbox"]):not([type="radio"]).invalid,
|
||||||
|
select.invalid,
|
||||||
|
textarea.invalid {
|
||||||
|
border-bottom: 1px solid var(--invalid);
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b94646' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
||||||
|
}
|
||||||
|
|
||||||
input[type="color"] {
|
input[type="color"] {
|
||||||
height: calc(3rem + 2px);
|
height: calc(3rem + 2px);
|
||||||
}
|
}
|
||||||
|
|
|
@ -409,12 +409,7 @@ hgroup {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
hgroup h1,
|
hgroup * {
|
||||||
hgroup h2,
|
|
||||||
hgroup h3,
|
|
||||||
hgroup h4,
|
|
||||||
hgroup h5,
|
|
||||||
hgroup h6 {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,31 +656,6 @@ textarea {
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[invalid]:not(:focus), input:not([type="checkbox"]):not([type="radio"])[valid]:not(:focus),
|
|
||||||
select[invalid]:not(:focus),
|
|
||||||
select[valid]:not(:focus),
|
|
||||||
textarea[invalid]:not(:focus),
|
|
||||||
textarea[valid]:not(:focus) {
|
|
||||||
padding-right: 2rem;
|
|
||||||
background-position: center right .75rem;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 1rem auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[invalid]:not(:focus),
|
|
||||||
select[invalid]:not(:focus),
|
|
||||||
textarea[invalid]:not(:focus) {
|
|
||||||
border-bottom: 1px solid var(--invalid);
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23b94646' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
input:not([type="checkbox"]):not([type="radio"])[valid]:not(:focus),
|
|
||||||
select[valid]:not(:focus),
|
|
||||||
textarea[valid]:not(:focus) {
|
|
||||||
border-bottom: 1px solid var(--valid);
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23288a6a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="color"] {
|
input[type="color"] {
|
||||||
height: calc(3rem + 2px);
|
height: calc(3rem + 2px);
|
||||||
}
|
}
|
||||||
|
|
2
css/pico.fluid.classless.min.css
vendored
2
css/pico.fluid.classless.min.css
vendored
File diff suppressed because one or more lines are too long
2
css/pico.min.css
vendored
2
css/pico.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -432,12 +432,7 @@ hgroup {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
hgroup h1,
|
hgroup * {
|
||||||
hgroup h2,
|
|
||||||
hgroup h3,
|
|
||||||
hgroup h4,
|
|
||||||
hgroup h5,
|
|
||||||
hgroup h6 {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
css/pico.slim.min.css
vendored
2
css/pico.slim.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -138,15 +138,15 @@
|
||||||
<h3>Pico is shipped with 2 consistents themes: Light & Dark.</h3>
|
<h3>Pico is shipped with 2 consistents themes: Light & Dark.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<p>The Light theme is used by default. The Dark theme is automatically enabled if user has dark mode enabled <code><i>prefers-color-scheme</i>: <u>dark</u></code>.</p>
|
<p>The Light theme is used by default. The Dark theme is automatically enabled if user has dark mode enabled <code><i>prefers-color-scheme</i>: <u>dark</u></code>.</p>
|
||||||
<article>
|
<article aria-label="Theme switcher">
|
||||||
<button class="contrast theme-switcher">...</button>
|
<button class="contrast theme-switcher">...</button>
|
||||||
</article>
|
</article>
|
||||||
<p>Themes can be forced on document level <code><<b>html</b> <i>data-theme</i>=<u>"light"</u>></code> or on any HTML element <code><<b>article</b> <i>data-theme</i>=<u>"dark"</u>></code>.</p>
|
<p>Themes can be forced on document level <code><<b>html</b> <i>data-theme</i>=<u>"light"</u>></code> or on any HTML element <code><<b>article</b> <i>data-theme</i>=<u>"dark"</u>></code>.</p>
|
||||||
<article data-theme="light">
|
<article data-theme="light">
|
||||||
<h4>Light theme</h4>
|
<h4>Light theme</h4>
|
||||||
<form class="grid">
|
<form class="grid">
|
||||||
<input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="login" required>
|
<input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="nickname" required>
|
||||||
<input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="password" required>
|
<input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="current-password" required>
|
||||||
<button type="submit" aria-label="Example button">Login</button>
|
<button type="submit" aria-label="Example button">Login</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -158,8 +158,8 @@
|
||||||
<article data-theme="dark">
|
<article data-theme="dark">
|
||||||
<h4>Dark theme</h4>
|
<h4>Dark theme</h4>
|
||||||
<form class="grid">
|
<form class="grid">
|
||||||
<input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="login" required>
|
<input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="nickname" required>
|
||||||
<input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="password" required>
|
<input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="current-password" required>
|
||||||
<button type="submit" aria-label="Example button">Login</button>
|
<button type="submit" aria-label="Example button">Login</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
@ -180,11 +180,11 @@
|
||||||
<article data-theme="generated">
|
<article data-theme="generated">
|
||||||
<h4><span class="name">Custom theme</span></h4>
|
<h4><span class="name">Custom theme</span></h4>
|
||||||
<form>
|
<form>
|
||||||
<section class="grid">
|
<div class="grid">
|
||||||
<input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="login" required>
|
<input type="text" name="login" placeholder="Login" aria-label="Login" autocomplete="nickname" required>
|
||||||
<input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="password" required>
|
<input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="current-password" required>
|
||||||
<button type="submit" aria-label="Example button">Login</button>
|
<button type="submit" aria-label="Example button">Login</button>
|
||||||
</section>
|
</div>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="remember">
|
<label for="remember">
|
||||||
<input type="checkbox" role="switch" id="remember" name="remember" checked aria-checked="true">
|
<input type="checkbox" role="switch" id="remember" name="remember" checked aria-checked="true">
|
||||||
|
@ -315,20 +315,20 @@
|
||||||
<h2>Grids</h2>
|
<h2>Grids</h2>
|
||||||
<h3><code>.grid</code> enable a minimal grid system with auto-layout columns.</h3>
|
<h3><code>.grid</code> enable a minimal grid system with auto-layout columns.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<article>
|
<article aria-label="Grid example">
|
||||||
<section class="grid">
|
<div class="grid">
|
||||||
<div>1</div>
|
<div>1</div>
|
||||||
<div>2</div>
|
<div>2</div>
|
||||||
<div>3</div>
|
<div>3</div>
|
||||||
<div>4</div>
|
<div>4</div>
|
||||||
</section>
|
</div>
|
||||||
|
|
||||||
<pre><code><<b>section</b> <i>class</i>=<u>"grid"</u>>
|
<pre><code><<b>div</b> <i>class</i>=<u>"grid"</u>>
|
||||||
<<b>div</b>>1</<b>div</b>>
|
<<b>div</b>>1</<b>div</b>>
|
||||||
<<b>div</b>>2</<b>div</b>>
|
<<b>div</b>>2</<b>div</b>>
|
||||||
<<b>div</b>>3</<b>div</b>>
|
<<b>div</b>>3</<b>div</b>>
|
||||||
<<b>div</b>>4</<b>div</b>>
|
<<b>div</b>>4</<b>div</b>>
|
||||||
</<b>section</b>></code></pre>
|
</<b>div</b>></code></pre>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Columns intentionally collapses below large devices <code>(<u>992px</u>)</code>.</p>
|
<p>Columns intentionally collapses below large devices <code>(<u>992px</u>)</code>.</p>
|
||||||
|
@ -493,7 +493,7 @@
|
||||||
</table>
|
</table>
|
||||||
</figure>
|
</figure>
|
||||||
<p>Headings:</p>
|
<p>Headings:</p>
|
||||||
<article>
|
<article aria-label="Headings examples">
|
||||||
<h1>Heading 1</h1>
|
<h1>Heading 1</h1>
|
||||||
<h2>Heading 2</h2>
|
<h2>Heading 2</h2>
|
||||||
<h3>Heading 3</h3>
|
<h3>Heading 3</h3>
|
||||||
|
@ -512,7 +512,7 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Inside a <code><<b>hgroup</b>></code> all <code><i>margin-bottom</i></code> are collapsed and the <code>:last-child</code> is styled.</p>
|
<p>Inside a <code><<b>hgroup</b>></code> all <code><i>margin-bottom</i></code> are collapsed and the <code>:last-child</code> is styled.</p>
|
||||||
<article>
|
<article aria-label="Hgroup example">
|
||||||
<hgroup>
|
<hgroup>
|
||||||
<h2>Heading 2</h2>
|
<h2>Heading 2</h2>
|
||||||
<h3>Subtitle for heading 2</h3>
|
<h3>Subtitle for heading 2</h3>
|
||||||
|
@ -525,7 +525,7 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Inline text elements:</p>
|
<p>Inline text elements:</p>
|
||||||
<article>
|
<article aria-label="Iinline text examples">
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div>
|
<div>
|
||||||
<p><abbr title="Abbreviation">Abbr.</abbr> <code>abbr</code></p>
|
<p><abbr title="Abbreviation">Abbr.</abbr> <code>abbr</code></p>
|
||||||
|
@ -546,7 +546,7 @@
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<p>Links come with <code>.secondary</code> and <code>.contrast</code> styles.</p>
|
<p>Links come with <code>.secondary</code> and <code>.contrast</code> styles.</p>
|
||||||
<article>
|
<article aria-label="Links examples">
|
||||||
<a href="#" onclick="event.preventDefault()">Primary</a><br>
|
<a href="#" onclick="event.preventDefault()">Primary</a><br>
|
||||||
<a href="#" onclick="event.preventDefault()" class="secondary">Secondary</a><br>
|
<a href="#" onclick="event.preventDefault()" class="secondary">Secondary</a><br>
|
||||||
<a href="#" onclick="event.preventDefault()" class="contrast">Contrast</a><br>
|
<a href="#" onclick="event.preventDefault()" class="contrast">Contrast</a><br>
|
||||||
|
@ -564,7 +564,7 @@
|
||||||
<h2>Buttons</h2>
|
<h2>Buttons</h2>
|
||||||
<h3>The essential button in pure HTML, without <code>.classes</code> for the default style.</h3>
|
<h3>The essential button in pure HTML, without <code>.classes</code> for the default style.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<article>
|
<article aria-label="Grid example">
|
||||||
<button aria-label="Example button">Button</button>
|
<button aria-label="Example button">Button</button>
|
||||||
<input type="submit">
|
<input type="submit">
|
||||||
|
|
||||||
|
@ -573,7 +573,7 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Buttons are <code><i>width</i>: <u>100%</u>;</code> by default. Use <code><<b>a</b> <i>role</i>=<u>"button"></u></code> if you need an inline element.</p>
|
<p>Buttons are <code><i>width</i>: <u>100%</u>;</code> by default. Use <code><<b>a</b> <i>role</i>=<u>"button"></u></code> if you need an inline element.</p>
|
||||||
<article>
|
<article aria-label="Inline buttons examples">
|
||||||
<a href="#" onclick="event.preventDefault()" role="button">Link</a>
|
<a href="#" onclick="event.preventDefault()" role="button">Link</a>
|
||||||
<a href="#" onclick="event.preventDefault()" role="button">Link</a>
|
<a href="#" onclick="event.preventDefault()" role="button">Link</a>
|
||||||
|
|
||||||
|
@ -582,7 +582,7 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Buttons come with <code>.secondary</code> and <code>.contrast</code> styles.</p>
|
<p>Buttons come with <code>.secondary</code> and <code>.contrast</code> styles.</p>
|
||||||
<article>
|
<article aria-label="Buttons styles examples">
|
||||||
<a href="#" onclick="event.preventDefault()" role="button" class="secondary">Secondary</a>
|
<a href="#" onclick="event.preventDefault()" role="button" class="secondary">Secondary</a>
|
||||||
<a href="#" onclick="event.preventDefault()" role="button" class="contrast">Contrast</a>
|
<a href="#" onclick="event.preventDefault()" role="button" class="contrast">Contrast</a>
|
||||||
|
|
||||||
|
@ -591,7 +591,7 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>And a classic <code>.outline</code> variant.</p>
|
<p>And a classic <code>.outline</code> variant.</p>
|
||||||
<article>
|
<article aria-label="Outline style examples">
|
||||||
<a href="#" onclick="event.preventDefault()" role="button" class="outline">Primary</a>
|
<a href="#" onclick="event.preventDefault()" role="button" class="outline">Primary</a>
|
||||||
<a href="#" onclick="event.preventDefault()" role="button" class="secondary outline">Secondary</a>
|
<a href="#" onclick="event.preventDefault()" role="button" class="secondary outline">Secondary</a>
|
||||||
<a href="#" onclick="event.preventDefault()" role="button" class="contrast outline">Contrast</a>
|
<a href="#" onclick="event.preventDefault()" role="button" class="contrast outline">Contrast</a>
|
||||||
|
@ -611,9 +611,9 @@
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<p>Input are <code><i>width</i>: <u>100%</u>;</code> by default. You can use <code>.grid</code> inside a form.</p>
|
<p>Input are <code><i>width</i>: <u>100%</u>;</code> by default. You can use <code>.grid</code> inside a form.</p>
|
||||||
<p>All natives form elements are fully customized and themables with CSS variables.</p>
|
<p>All natives form elements are fully customized and themables with CSS variables.</p>
|
||||||
<article>
|
<article aria-label="Form example">
|
||||||
<form>
|
<form>
|
||||||
<section class="grid">
|
<div class="grid">
|
||||||
<label for="firstname">
|
<label for="firstname">
|
||||||
First name
|
First name
|
||||||
<input type="text" id="firstname" name="firstname" placeholder="First name" required>
|
<input type="text" id="firstname" name="firstname" placeholder="First name" required>
|
||||||
|
@ -622,7 +622,7 @@
|
||||||
Last name
|
Last name
|
||||||
<input type="text" id="lastname" name="lastname" placeholder="Last name" required>
|
<input type="text" id="lastname" name="lastname" placeholder="Last name" required>
|
||||||
</label>
|
</label>
|
||||||
</section>
|
</div>
|
||||||
<label for="email">Email address</label>
|
<label for="email">Email address</label>
|
||||||
<input type="email" id="email" name="email" placeholder="Email address" required>
|
<input type="email" id="email" name="email" placeholder="Email address" required>
|
||||||
<small>We'll never share your email with anyone else.</small>
|
<small>We'll never share your email with anyone else.</small>
|
||||||
|
@ -633,7 +633,7 @@
|
||||||
<<b>form</b>>
|
<<b>form</b>>
|
||||||
|
|
||||||
<em><!-- Grid --></em>
|
<em><!-- Grid --></em>
|
||||||
<<b>section</b> <i>class</i>=<u>"grid"</u>>
|
<<b>div</b> <i>class</i>=<u>"grid"</u>>
|
||||||
|
|
||||||
<em><!-- Markup example 1: input is inside label --></em>
|
<em><!-- Markup example 1: input is inside label --></em>
|
||||||
<<b>label</b> <i>for</i>=<u>"firstname"</u>>
|
<<b>label</b> <i>for</i>=<u>"firstname"</u>>
|
||||||
|
@ -646,7 +646,7 @@
|
||||||
<<b>input</b> <i>type</i>=<u>"text"</u> <i>id</i>=<u>"lastname"</u> <i>name</i>=<u>"lastname"</u> <i>placeholder</i>=<u>"Last name"</u> <i>required</i>>
|
<<b>input</b> <i>type</i>=<u>"text"</u> <i>id</i>=<u>"lastname"</u> <i>name</i>=<u>"lastname"</u> <i>placeholder</i>=<u>"Last name"</u> <i>required</i>>
|
||||||
</<b>label</b>>
|
</<b>label</b>>
|
||||||
|
|
||||||
</<b>section</b>>
|
</<b>div</b>>
|
||||||
|
|
||||||
<em><!-- Markup example 2: input is after label --></em>
|
<em><!-- Markup example 2: input is after label --></em>
|
||||||
<<b>label</b> <i>for</i>=<u>"email"</u>>Email address</<b>label</b>>
|
<<b>label</b> <i>for</i>=<u>"email"</u>>Email address</<b>label</b>>
|
||||||
|
@ -660,23 +660,23 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Disabled and validation states:</p>
|
<p>Disabled and validation states:</p>
|
||||||
<article>
|
<article aria-label="Validation states examples">
|
||||||
<form class="grid">
|
<form class="grid">
|
||||||
<input type="text" placeholder="Valid" aria-label="Valid" valid>
|
<input type="text" placeholder="Valid" aria-label="Valid" class="valid">
|
||||||
<input type="text" placeholder="Invalid" aria-label="Invalid" invalid>
|
<input type="text" placeholder="Invalid" aria-label="Invalid" class="invalid">
|
||||||
<input type="text" placeholder="Disabled" aria-label="Disabled" disabled>
|
<input type="text" placeholder="Disabled" aria-label="Disabled" disabled>
|
||||||
<input type="text" value="Readonly" aria-label="Readonly" readonly>
|
<input type="text" value="Readonly" aria-label="Readonly" readonly>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<pre><code><<b>input</b> <i>type</i>=<u>"text"</u> <i>placeholder</i>=<u>"Valid"</u> <i>valid</i>>
|
<pre><code><<b>input</b> <i>type</i>=<u>"text"</u> <i>placeholder</i>=<u>"Valid"</u> <i>class</i>=<u>"valid"</u>>
|
||||||
<<b>input</b> <i>type</i>=<u>"text"</u> <i>placeholder</i>=<u>"Invalid"</u> <i>invalid</i>>
|
<<b>input</b> <i>type</i>=<u>"text"</u> <i>placeholder</i>=<u>"Invalid"</u> <i>class</i>=<u>"invalid"</u>>
|
||||||
<<b>input</b> <i>type</i>=<u>"text"</u> <i>placeholder</i>=<u>"Disabled"</u> <i>disabled</i>>
|
<<b>input</b> <i>type</i>=<u>"text"</u> <i>placeholder</i>=<u>"Disabled"</u> <i>disabled</i>>
|
||||||
<<b>input</b> <i>type</i>=<u>"text"</u> <i>value</i>=<u>"Readonly"</u> <i>readonly</i>></code></pre>
|
<<b>input</b> <i>type</i>=<u>"text"</u> <i>value</i>=<u>"Readonly"</u> <i>readonly</i>></code></pre>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p><code><<b>fieldset</b>></code> are unstyled and act as a container for radios and checkboxes providing a consistent <code><i>margin-bottom</i></code> for the set.</p>
|
<p><code><<b>fieldset</b>></code> are unstyled and act as a container for radios and checkboxes providing a consistent <code><i>margin-bottom</i></code> for the set.</p>
|
||||||
<p><code><i>role</i>=<u>"switch"</u></code> on a <code><i>type</i>=<u>"checkbox"</u></code> enable a custom switch.</p>
|
<p><code><i>role</i>=<u>"switch"</u></code> on a <code><i>type</i>=<u>"checkbox"</u></code> enable a custom switch.</p>
|
||||||
<article>
|
<article aria-label="Select, radios, checkboxes, switch examples">
|
||||||
<label for="country">Country</label>
|
<label for="country">Country</label>
|
||||||
<select id="country">
|
<select id="country">
|
||||||
<option selected>Choose...</option>
|
<option selected>Choose...</option>
|
||||||
|
@ -759,7 +759,7 @@
|
||||||
<h2>Accordions</h2>
|
<h2>Accordions</h2>
|
||||||
<h3>Toggle sections of content in pure HTML, without JavaScript.</h3>
|
<h3>Toggle sections of content in pure HTML, without JavaScript.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<article>
|
<article aria-label="Accordions examples">
|
||||||
<details>
|
<details>
|
||||||
<summary>Collapsible elements 1</summary>
|
<summary>Collapsible elements 1</summary>
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque urna diam, tincidunt nec porta sed, auctor id velit. Etiam venenatis nisl ut orci consequat, vitae tempus quam commodo. Nulla non mauris ipsum. Aliquam eu posuere orci. Nulla convallis lectus rutrum quam hendrerit, in facilisis elit sollicitudin. Mauris pulvinar pulvinar mi, dictum tristique elit auctor quis. Maecenas ac ipsum ultrices, porta turpis sit amet, congue turpis.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque urna diam, tincidunt nec porta sed, auctor id velit. Etiam venenatis nisl ut orci consequat, vitae tempus quam commodo. Nulla non mauris ipsum. Aliquam eu posuere orci. Nulla convallis lectus rutrum quam hendrerit, in facilisis elit sollicitudin. Mauris pulvinar pulvinar mi, dictum tristique elit auctor quis. Maecenas ac ipsum ultrices, porta turpis sit amet, congue turpis.</p>
|
||||||
|
@ -797,12 +797,12 @@
|
||||||
<h2>Cards</h2>
|
<h2>Cards</h2>
|
||||||
<h3>A flexible container with graceful spacings across devices and viewport sizes.</h3>
|
<h3>A flexible container with graceful spacings across devices and viewport sizes.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<article>
|
<article aria-label="Card example">
|
||||||
I'm a card!
|
I'm a card!
|
||||||
</article>
|
</article>
|
||||||
<pre><code><<b>article</b>>I'm a card!</<b>article</b>></code></pre>
|
<pre><code><<b>article</b>>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>
|
<p>You can use <code><<b>header</b>></code> and footer <code><<b>footer</b>></code> inside <code><<b>article</b>></code></p>
|
||||||
<article>
|
<article aria-label="Card sectioning example">
|
||||||
Body
|
Body
|
||||||
<footer>Footer</footer>
|
<footer>Footer</footer>
|
||||||
</article>
|
</article>
|
||||||
|
@ -820,7 +820,7 @@
|
||||||
<h2>Navs</h2>
|
<h2>Navs</h2>
|
||||||
<h3>The essential navbar component in pure semantic HTML.</h3>
|
<h3>The essential navbar component in pure semantic HTML.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<article>
|
<article aria-label="Nav example">
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>Brand</strong></li>
|
<li><strong>Brand</strong></li>
|
||||||
|
@ -846,7 +846,7 @@
|
||||||
</article>
|
</article>
|
||||||
<p><code><<b>ul</b>></code> are automatically distributed horizontally.</p>
|
<p><code><<b>ul</b>></code> are automatically distributed horizontally.</p>
|
||||||
<p><code><<b>li</b>></code> are unstyled and inlined.</p>
|
<p><code><<b>li</b>></code> are unstyled and inlined.</p>
|
||||||
<article>
|
<article aria-label="Nav example">
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -888,7 +888,7 @@
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
<p>Inside <code><<b>aside</b>></code>, navs are stacked vertically.</p>
|
<p>Inside <code><<b>aside</b>></code>, navs are stacked vertically.</p>
|
||||||
<article>
|
<article aria-label="Vertical nav example">
|
||||||
<aside>
|
<aside>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -918,7 +918,7 @@
|
||||||
<h2>Tooltips</h2>
|
<h2>Tooltips</h2>
|
||||||
<h3>Enable tooltips everywhere in pure HTML, without JavaScript.</h3>
|
<h3>Enable tooltips everywhere in pure HTML, without JavaScript.</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<article>
|
<article aria-label="Tooltips examples">
|
||||||
<p>Tooltip on a <a href="#" onclick="event.preventDefault()" data-tooltip="Tooltip">link</a></p>
|
<p>Tooltip on a <a href="#" onclick="event.preventDefault()" data-tooltip="Tooltip">link</a></p>
|
||||||
<p>Tooltip on <em data-tooltip="Tooltip">inline element</em></p>
|
<p>Tooltip on <em data-tooltip="Tooltip">inline element</em></p>
|
||||||
<p><button data-tooltip="Tooltip" aria-label="Example button">Tooltip on a button</button></p>
|
<p><button data-tooltip="Tooltip" aria-label="Example button">Tooltip on a button</button></p>
|
||||||
|
@ -936,13 +936,13 @@
|
||||||
<p>As a starting point, Pico chose to be as neutral and semantic as possible using very few <code>.classes</code>.</p>
|
<p>As a starting point, Pico chose to be as neutral and semantic as possible using very few <code>.classes</code>.</p>
|
||||||
<p>But off course, <code>.classes</code> are not a bad practice at all.</p>
|
<p>But off course, <code>.classes</code> are not a bad practice at all.</p>
|
||||||
<p>Feel free to use <em>modifiers</em>.</p>
|
<p>Feel free to use <em>modifiers</em>.</p>
|
||||||
<section data-theme="valid">
|
<div data-theme="valid">
|
||||||
<pre><code><<b>button</b> <i>class</i>=<u>"warning"</u>>Action</<b>button</b>><br></code></pre>
|
<pre><code><<b>button</b> <i>class</i>=<u>"warning"</u>>Action</<b>button</b>><br></code></pre>
|
||||||
</section>
|
</div>
|
||||||
<p>Just try to keep your HTML clean and semantic to keep the Pico spirit.</p>
|
<p>Just try to keep your HTML clean and semantic to keep the Pico spirit.</p>
|
||||||
<section data-theme="invalid">
|
<div data-theme="invalid">
|
||||||
<pre><code><<b>button</b> <i>class</i>=<u>"button-red margin-large padding-medium"</u>>Action</<b>button</b>><br></code></pre>
|
<pre><code><<b>button</b> <i>class</i>=<u>"button-red margin-large padding-medium"</u>>Action</<b>button</b>><br></code></pre>
|
||||||
</section>
|
</div>
|
||||||
</section><!-- ./ Love -->
|
</section><!-- ./ Love -->
|
||||||
|
|
||||||
<!-- Footer -->
|
<!-- Footer -->
|
||||||
|
|
|
@ -175,30 +175,30 @@ textarea {
|
||||||
margin-bottom: $spacing-typography;
|
margin-bottom: $spacing-typography;
|
||||||
padding: $spacing-input-button;
|
padding: $spacing-input-button;
|
||||||
|
|
||||||
@if $enable-input-states {
|
@if $enable-input-states and $enable-classes {
|
||||||
|
|
||||||
// Validation states
|
// Validation states
|
||||||
&[invalid]:not(:focus),
|
&.valid,
|
||||||
&[valid]:not(:focus) {
|
&.invalid {
|
||||||
padding-right: 2rem;
|
padding-right: 2rem;
|
||||||
background-position: center right .75rem;
|
background-position: center right .75rem;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 1rem auto;
|
background-size: 1rem auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
&[invalid]:not(:focus) {
|
&.valid {
|
||||||
// Source: https://feathericons.com/
|
|
||||||
$invalid-icon-color: "b94646"; // Without '#' !important
|
|
||||||
border-bottom: 1px solid var(--invalid);
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $invalid-icon-color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
|
||||||
}
|
|
||||||
|
|
||||||
&[valid]:not(:focus) {
|
|
||||||
// Source: https://feathericons.com/
|
// Source: https://feathericons.com/
|
||||||
$valid-icon-color: "288a6a"; // Without '#' !important
|
$valid-icon-color: "288a6a"; // Without '#' !important
|
||||||
border-bottom: 1px solid var(--valid);
|
border-bottom: 1px solid var(--valid);
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $valid-icon-color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $valid-icon-color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.invalid {
|
||||||
|
// Source: https://feathericons.com/
|
||||||
|
$invalid-icon-color: "b94646"; // Without '#' !important
|
||||||
|
border-bottom: 1px solid var(--invalid);
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $invalid-icon-color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,14 +176,10 @@ h6 {
|
||||||
hgroup {
|
hgroup {
|
||||||
margin-bottom: $spacing-typography;
|
margin-bottom: $spacing-typography;
|
||||||
|
|
||||||
h1,
|
*{
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6{
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
> *:last-child {
|
> *:last-child {
|
||||||
color: var(--muted-text);
|
color: var(--muted-text);
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue