diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000..bc03da2d --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,3 @@ +>= 0.5% +last 2 major versions +not dead \ No newline at end of file diff --git a/README.md b/README.md index 0ce59cab..38459ced 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ All examples are open-sourced in [picocss/examples](https://github.com/picocss/e - [`dev`](https://github.com/picocss/pico/tree/dev) branch is open to pull requests. - Do not edit [`/css`](https://github.com/picocss/pico/tree/master/css) files directly. -- Edit the source files in [`/scss`](https://github.com/picocss/pico/tree/master/scss), then recompile the [`/css`](https://github.com/picocss/pico/tree/master/css) files with `npm run build`. +- Edit the source files in [`/scss`](https://github.com/picocss/pico/tree/master/scss), then recompile the [`/css`](https://github.com/picocss/pico/tree/master/css) files with `npm run build:css`. ## Copyright and license @@ -178,6 +178,7 @@ Licensed under the [MIT License](https://github.com/picocss/pico/blob/master/LIC Website and docs: - [TypeIt](https://typeitjs.com/): JavaScript animated typing utility (Licensed [GPL-3.0](https://github.com/alexmacarthur/typeit/blob/master/LICENSE)) +- [Most Visible](https://github.com/andyexeter/most-visible): JavaScript module which returns the most visible element (Licensed [MIT](https://github.com/andyexeter/most-visible/blob/master/LICENSE)) - [Font Awesome](https://fontawesome.com/): Icons (Licensed [CC BY 4.0](https://fontawesome.com/license/free)) Pico Library: diff --git a/css/pico.slim.css b/css/pico.slim.css index c2f86301..3e0abecd 100644 --- a/css/pico.slim.css +++ b/css/pico.slim.css @@ -202,21 +202,19 @@ kbd { 0 0.125rem 2rem rgba(27, 40, 50, 0.08), 0 0 0 0.0625rem rgba(27, 40, 50, 0.024); --card-sectionning-background-color: #fbfbfc; - --modal-overlay-background-color: rgba(213, 220, 226, 0.8); --progress-background-color: #d5dce2; --progress-color: var(--primary); --loading-spinner-opacity: 0.5; --tooltip-background-color: var(--contrast); --tooltip-color: var(--contrast-inverse); - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='rgba(115, 130, 140, 0.999)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='rgba(198, 40, 40, 0.999)' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='rgba(56, 142, 60, 0.999)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='rgba(198, 40, 40, 0.999)' 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"); } @media only screen and (prefers-color-scheme: dark) { @@ -297,21 +295,19 @@ kbd { 0 0.125rem 2rem rgba(0, 0, 0, 0.12), 0 0 0 0.0625rem rgba(0, 0, 0, 0.036); --card-sectionning-background-color: #18232c; - --modal-overlay-background-color: rgba(36, 51, 62, 0.9); --progress-background-color: #24333e; --progress-color: var(--primary); --loading-spinner-opacity: 0.5; --tooltip-background-color: var(--contrast); --tooltip-color: var(--contrast-inverse); - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='rgba(115, 130, 140, 0.999)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='rgba(46, 125, 50, 0.999)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); } } [data-theme=dark] { @@ -391,21 +387,19 @@ kbd { 0 0.125rem 2rem rgba(0, 0, 0, 0.12), 0 0 0 0.0625rem rgba(0, 0, 0, 0.036); --card-sectionning-background-color: #18232c; - --modal-overlay-background-color: rgba(36, 51, 62, 0.9); --progress-background-color: #24333e; --progress-color: var(--primary); --loading-spinner-opacity: 0.5; --tooltip-background-color: var(--contrast); --tooltip-color: var(--contrast-inverse); - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='rgba(115, 130, 140, 0.999)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='rgba(46, 125, 50, 0.999)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); } /** @@ -427,18 +421,18 @@ kbd { html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; -ms-text-size-adjust: 100%; - text-rendering: optimizeLegibility; background-color: var(--background-color); color: var(--color); - font-weight: var(--font-weight); - font-size: var(--font-size); - line-height: var(--line-height); font-family: var(--font-family); + font-size: var(--font-size); + font-weight: var(--font-weight); + line-height: var(--line-height); + text-rendering: optimizeLegibility; cursor: default; - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; } /** @@ -591,9 +585,9 @@ ul { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--color); - font-style: normal; - font-weight: var(--font-weight); font-size: var(--font-size); + font-weight: var(--font-weight); + font-style: normal; } a { @@ -603,7 +597,7 @@ a { background-color: var(--background-color); color: var(--color); -webkit-text-decoration: var(--text-decoration); - text-decoration: var(--text-decoration); + text-decoration: var(--text-decoration); } a:hover, a:active, a:focus { --color: var(--primary-hover); @@ -640,9 +634,9 @@ h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--color); - font-weight: var(--font-weight); - font-size: var(--font-size); font-family: var(--font-family); + font-size: var(--font-size); + font-weight: var(--font-weight); } h1 { @@ -736,8 +730,8 @@ hgroup > * { hgroup > *:last-child { --color: var(--muted-color); --font-weight: unset; - font-size: 1rem; font-family: unset; + font-size: 1rem; } p { @@ -752,10 +746,10 @@ ul, ol { padding-right: 0; padding-left: var(--spacing); - -webkit-padding-start: var(--spacing); - padding-inline-start: var(--spacing); -webkit-padding-end: 0; - padding-inline-end: 0; + padding-inline-end: 0; + -webkit-padding-start: var(--spacing); + padding-inline-start: var(--spacing); } ul li, ol li { @@ -779,10 +773,10 @@ blockquote { padding: var(--spacing); border-right: none; border-left: 0.25rem solid var(--blockquote-border-color); - -webkit-border-start: 0.25rem solid var(--blockquote-border-color); - border-inline-start: 0.25rem solid var(--blockquote-border-color); -webkit-border-end: none; - border-inline-end: none; + border-inline-end: none; + -webkit-border-start: 0.25rem solid var(--blockquote-border-color); + border-inline-start: 0.25rem solid var(--blockquote-border-color); } blockquote footer { margin-top: calc(var(--typography-spacing-vertical) * 0.5); @@ -904,8 +898,8 @@ a[role=button] { background-color: var(--background-color); box-shadow: var(--box-shadow); color: var(--color); - font-weight: var(--font-weight); font-size: 1rem; + font-weight: var(--font-weight); line-height: var(--line-height); text-align: center; cursor: pointer; @@ -1104,10 +1098,10 @@ optgroup, select, textarea { margin: 0; - font-size: 1rem; - line-height: var(--line-height); font-family: inherit; + font-size: 1rem; letter-spacing: inherit; + line-height: var(--line-height); } input { @@ -1203,8 +1197,8 @@ input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { -webkit-appearance: none; - -moz-appearance: none; - appearance: none; + -moz-appearance: none; + appearance: none; padding: var(--form-element-spacing-vertical) var(--form-element-spacing-horizontal); vertical-align: middle; } @@ -1260,13 +1254,13 @@ select:not([type=checkbox]):not([type=radio])[aria-invalid], textarea:not([type=checkbox]):not([type=radio])[aria-invalid] { padding-right: calc(var(--form-element-spacing-horizontal) + 1.5rem); padding-left: var(--form-element-spacing-horizontal); - -webkit-padding-start: var(--form-element-spacing-horizontal); - padding-inline-start: var(--form-element-spacing-horizontal); -webkit-padding-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); - padding-inline-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); + padding-inline-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); + -webkit-padding-start: var(--form-element-spacing-horizontal); + padding-inline-start: var(--form-element-spacing-horizontal); background-position: center right 0.75rem; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; } input:not([type=checkbox]):not([type=radio])[aria-invalid=false], select:not([type=checkbox]):not([type=radio])[aria-invalid=false], @@ -1305,13 +1299,9 @@ textarea[aria-invalid=true]:focus { --box-shadow: 0 0 0 var(--outline-width) var(--form-element-invalid-focus-color); } -[dir=rtl] input:not([type=checkbox]):not([type=radio])[aria-invalid], [dir=rtl] input:not([type=checkbox]):not([type=radio])[aria-invalid=true], [dir=rtl] input:not([type=checkbox]):not([type=radio])[aria-invalid=false], -[dir=rtl] select:not([type=checkbox]):not([type=radio])[aria-invalid], -[dir=rtl] select:not([type=checkbox]):not([type=radio])[aria-invalid=true], -[dir=rtl] select:not([type=checkbox]):not([type=radio])[aria-invalid=false], -[dir=rtl] textarea:not([type=checkbox]):not([type=radio])[aria-invalid], -[dir=rtl] textarea:not([type=checkbox]):not([type=radio])[aria-invalid=true], -[dir=rtl] textarea:not([type=checkbox]):not([type=radio])[aria-invalid=false] { +[dir=rtl] input[aria-invalid], +[dir=rtl] select[aria-invalid], +[dir=rtl] textarea[aria-invalid] { background-position: center left 0.75rem; } @@ -1337,14 +1327,14 @@ select::-ms-expand { select:not([multiple]):not([size]) { padding-right: calc(var(--form-element-spacing-horizontal) + 1.5rem); padding-left: var(--form-element-spacing-horizontal); - -webkit-padding-start: var(--form-element-spacing-horizontal); - padding-inline-start: var(--form-element-spacing-horizontal); -webkit-padding-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); - padding-inline-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); + padding-inline-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); + -webkit-padding-start: var(--form-element-spacing-horizontal); + padding-inline-start: var(--form-element-spacing-horizontal); background-image: var(--icon-chevron); background-position: center right 0.75rem; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; } [dir=rtl] select:not([multiple]):not([size]) { @@ -1381,8 +1371,8 @@ td { padding: calc(var(--spacing) / 2) var(--spacing); border-bottom: var(--border-width) solid var(--table-border-color); color: var(--color); - font-weight: var(--font-weight); font-size: var(--font-size); + font-weight: var(--font-weight); text-align: left; text-align: start; } @@ -1431,5 +1421,3 @@ textarea, [dir=rtl] { direction: rtl; } - -/*# sourceMappingURL=pico.slim.css.map */ \ No newline at end of file diff --git a/css/postcss.config.js b/css/postcss.config.js deleted file mode 100644 index e2d2f1dd..00000000 --- a/css/postcss.config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - map: { - inline: false, - annotation: true, - sourcesContent: true - }, - plugins: { - autoprefixer: { - cascade: false - } - } -} \ No newline at end of file diff --git a/css/themes/default.css b/css/themes/default.css index 15b94c4e..338b3e98 100644 --- a/css/themes/default.css +++ b/css/themes/default.css @@ -96,23 +96,6 @@ section { } } -dialog > article { - --block-spacing-vertical: calc(var(--spacing) * 2); - --block-spacing-horizontal: var(--spacing); -} -@media (min-width: 576px) { - dialog > article { - --block-spacing-vertical: calc(var(--spacing) * 2.5); - --block-spacing-horizontal: calc(var(--spacing) * 1.25); - } -} -@media (min-width: 768px) { - dialog > article { - --block-spacing-vertical: calc(var(--spacing) * 3); - --block-spacing-horizontal: calc(var(--spacing) * 1.5); - } -} - a { --text-decoration: none; } @@ -266,21 +249,19 @@ kbd { 0 0.125rem 2rem rgba(27, 40, 50, 0.08), 0 0 0 0.0625rem rgba(27, 40, 50, 0.024); --card-sectionning-background-color: #fbfbfc; - --modal-overlay-background-color: rgba(213, 220, 226, 0.8); --progress-background-color: #d5dce2; --progress-color: var(--primary); --loading-spinner-opacity: 0.5; --tooltip-background-color: var(--contrast); --tooltip-color: var(--contrast-inverse); - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='rgba(115, 130, 140, 0.999)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='rgba(198, 40, 40, 0.999)' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='rgba(65, 84, 98, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='rgba(56, 142, 60, 0.999)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='rgba(198, 40, 40, 0.999)' 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"); } @media only screen and (prefers-color-scheme: dark) { @@ -361,21 +342,19 @@ kbd { 0 0.125rem 2rem rgba(0, 0, 0, 0.12), 0 0 0 0.0625rem rgba(0, 0, 0, 0.036); --card-sectionning-background-color: #18232c; - --modal-overlay-background-color: rgba(36, 51, 62, 0.9); --progress-background-color: #24333e; --progress-color: var(--primary); --loading-spinner-opacity: 0.5; --tooltip-background-color: var(--contrast); --tooltip-color: var(--contrast-inverse); - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='rgba(115, 130, 140, 0.999)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='rgba(46, 125, 50, 0.999)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); } } [data-theme=dark] { @@ -455,21 +434,17 @@ kbd { 0 0.125rem 2rem rgba(0, 0, 0, 0.12), 0 0 0 0.0625rem rgba(0, 0, 0, 0.036); --card-sectionning-background-color: #18232c; - --modal-overlay-background-color: rgba(36, 51, 62, 0.9); --progress-background-color: #24333e; --progress-color: var(--primary); --loading-spinner-opacity: 0.5; --tooltip-background-color: var(--contrast); --tooltip-color: var(--contrast-inverse); - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='rgba(115, 130, 140, 0.999)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='rgba(162, 175, 185, 0.999)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='rgba(46, 125, 50, 0.999)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='rgba(183, 28, 28, 0.999)' 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"); } - -/*# sourceMappingURL=default.css.map */ \ No newline at end of file diff --git a/docs/accordions.html b/docs/accordions.html deleted file mode 100644 index 172901b7..00000000 --- a/docs/accordions.html +++ /dev/null @@ -1,12 +0,0 @@ -Accordions • Pico.css

Accordions

Toggle sections of content in pure HTML, without JavaScript.

Collapsible elements 1

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.

Collapsible elements 2
  • Vestibulum id elit quis massa interdum sodales.
  • Nunc quis eros vel odio pretium tincidunt nec quis neque.
  • Quisque sed eros non eros ornare elementum.
  • Cras sed libero aliquet, porta dolor quis, dapibus ipsum.
<details>
-  <summary>Collapsible elements 1</summary>
-  <p>…</p>
-</details>
-
-<details open>
-  <summary>Collapsible elements 2</summary>
-  <ul>
-    <li>…</li>
-    <li>…</li>
-  </ul>
-</details>
\ No newline at end of file diff --git a/docs/buttons.html b/docs/buttons.html deleted file mode 100644 index 50c59c84..00000000 --- a/docs/buttons.html +++ /dev/null @@ -1,6 +0,0 @@ -Buttons • Pico.css

Buttons

The essential button in pure HTML, without .classes for the default style.

<button>Button</button>
-<input type="submit">

Buttons are width: 100%; by default. Use <a role="button"> if you need an inline element.

Link Link
<a href="#" role="button">Link</a>
-<a href="#" role="button">Link</a>

Buttons come with .secondary and .contrast styles.

Secondary Contrast
<a href="#" role="button" class="secondary">Secondary</a>
-<a href="#" role="button" class="contrast">Contrast</a>

And a classic .outline variant.

Primary Secondary Contrast
<a href="#" role="button" class="outline">Primary</a>
-<a href="#" role="button" class="secondary outline">Secondary</a>
-<a href="#" role="button" class="contrast outline">Contrast</a>
\ No newline at end of file diff --git a/docs/cards.html b/docs/cards.html deleted file mode 100644 index 77c9c86e..00000000 --- a/docs/cards.html +++ /dev/null @@ -1,5 +0,0 @@ -Cards • Pico.css

Cards

A flexible container with graceful spacings across devices and viewports.

I'm a card!
<article>I'm a card!</article>

You can use <header> and footer <footer> inside <article>

Header
Body
Footer
<article>
-  <header>Header</header>
-  Body
-  <footer>Footer</footer>
-</article>
\ No newline at end of file diff --git a/docs/classless.html b/docs/classless.html deleted file mode 100644 index febe8ab1..00000000 --- a/docs/classless.html +++ /dev/null @@ -1,5 +0,0 @@ -Class-less version • Pico.css

Class-less version

For wild HTML purists!

Pico provides a .classless version (example).

In this version, <header>, <main>, and <footer> act as containers to define a centered or a fluid viewport.

Usage:

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

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

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

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

These .classless versions are also available on unpkg CDN:

// Centered viewport
-<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.classless.min.css">
-
// Fluid viewport
-<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.fluid.classless.min.css">
-
\ No newline at end of file diff --git a/docs/css/pico.docs.css b/docs/css/pico.docs.css index 9b9ad88e..fce5f0ca 100644 --- a/docs/css/pico.docs.css +++ b/docs/css/pico.docs.css @@ -55,7 +55,7 @@ body > main { @media (min-width: 992px) { body > main { --block-spacing-horizontal: calc(var(--spacing) * 1.75); - grid-column-gap: calc(var(--block-spacing-horizontal) * 3); + grid-column-gap: calc(var(--block-spacing-horizontal) * 4); display: grid; grid-template-columns: 200px auto; } @@ -70,14 +70,45 @@ body > main div[role=document] { min-width: 0; } +div[role=document] > section::before { + display: block; + height: calc(2rem + 3.5rem - 0.5rem); + margin-top: calc(-2rem - 3.5rem + 0.5rem); + content: ""; +} +@media (min-width: 576px) { + div[role=document] > section::before { + height: calc(2.5rem + 3.5rem - 0.5rem); + height: calc(-2.5rem - 3.5rem + 0.5rem); + } +} +@media (min-width: 768px) { + div[role=document] > section::before { + height: calc(3rem + 3.5rem - 0.5rem); + margin-top: calc(-3rem - 3.5rem + 0.5rem); + } +} +@media (min-width: 992px) { + div[role=document] > section::before { + height: calc(3.5rem + 3.5rem - 0.5rem); + margin-top: calc(-3.5rem - 3.5rem + 0.5rem); + } +} +@media (min-width: 1200px) { + div[role=document] > section::before { + height: calc(4rem + 3.5rem - 0.5rem); + margin-top: calc(-4rem - 3.5rem + 0.5rem); + } +} + div[role=document] section a[href*="//"]:not([href*="https://picocss.com"]):not([role])::after { display: inline-block; width: 1rem; height: 1rem; background-image: var(--icon-external); background-position: top center; - background-size: 0.66rem auto; background-repeat: no-repeat; + background-size: 0.66rem auto; content: ""; } @@ -90,7 +121,10 @@ svg { */ main > aside nav { width: 100%; - margin-bottom: calc(var(--block-spacing-vertical) * 2); + margin-bottom: var(--block-spacing-vertical); +} +main > aside nav h1 { + margin-bottom: calc(var(--typography-spacing-vertical) / 2); } @media (min-width: 992px) { main > aside nav { @@ -101,43 +135,10 @@ main > aside nav { overflow-x: hidden; overflow-y: auto; } -} -main > aside nav a#toggle-docs-navigation { - margin: 0; - margin-bottom: var(--spacing); - padding: 0; - padding-bottom: var(--spacing); - border-bottom: var(--border-width) solid var(--accordion-border-color); -} -main > aside nav a#toggle-docs-navigation svg { - margin-right: calc(var(--spacing) * 0.5); - vertical-align: -3px; -} -@media (min-width: 992px) { - main > aside nav a#toggle-docs-navigation { + main > aside nav h1 { display: none; } } -main > aside nav.closed-on-mobile { - margin-bottom: var(--block-spacing-vertical); -} -main > aside nav.closed-on-mobile a#toggle-docs-navigation svg.collapse { - display: none; -} -main > aside nav.closed-on-mobile details { - display: none; -} -@media (min-width: 992px) { - main > aside nav.closed-on-mobile details { - display: block; - } - main > aside nav.closed-on-mobile > a#toggle-docs-navigation { - display: none; - } -} -main > aside nav.open a#toggle-docs-navigation svg.expand { - display: none; -} main > aside li, main > aside summary { padding-top: 0; @@ -145,7 +146,7 @@ main > aside summary { font-size: 16px; } main > aside li a { - padding: 0.375rem 0.5rem; + padding: 0.25rem 0.5rem; } main > aside li a svg { vertical-align: middle; @@ -159,20 +160,18 @@ main > aside a.active:hover { color: var(--primary); } main > aside details { + padding-bottom: 0.25rem; border-bottom: none; } main > aside details summary { color: var(--h1-color); - font-weight: 300; font-size: 14px; + font-weight: 300; text-transform: uppercase; } main > aside details summary::after { display: none; } -main > aside details[open] > summary { - margin-bottom: calc(var(--spacing) * 0.75); -} main > aside details[open] > summary:not(:focus) { color: var(--h1-color); } @@ -180,24 +179,21 @@ main > aside details[open] > summary:not(:focus) { /** * Docs: Documentation */ -#themes button.theme-switcher:first-of-type { - --font-weight: bold; -} -#themes button.theme-switcher i { +#themes button i { font-style: normal; } #customization figure { display: grid; - grid-template-rows: repeat(2, 1fr); grid-template-columns: repeat(9, 1fr); + grid-template-rows: repeat(2, 1fr); margin-bottom: 0; overflow: hidden; } @media (min-width: 576px) { #customization figure { - grid-template-rows: 1fr; grid-template-columns: repeat(18, 1fr); + grid-template-rows: 1fr; border-top-right-radius: var(--border-radius); border-top-left-radius: var(--border-radius); } @@ -220,8 +216,8 @@ main > aside details[open] > summary:not(:focus) { #customization figure button.picked { background-image: var(--icon-check); background-position: center; - background-size: 0.66rem auto; background-repeat: no-repeat; + background-size: 0.66rem auto; box-shadow: inset 0 0 1rem 0 rgba(0, 0, 0, 0.25); } #customization figure button[data-color=lime].picked, #customization figure button[data-color=yellow].picked, #customization figure button[data-color=amber].picked { @@ -234,39 +230,39 @@ main > aside details[open] > summary:not(:focus) { border-color: var(--primary); } -#grid { +#grids { --grid-spacing-vertical: 1rem; } -#grid button { +#grids button { display: block; width: 100%; margin-bottom: var(--spacing); } @media (min-width: 576px) { - #grid button { + #grids button { display: inline-block; width: auto; margin-right: 0.5rem; } } -#grid button svg { +#grids button svg { stroke: var(--secondary); margin-right: 0.5rem; border: 2px solid currentColor; border-radius: 1rem; background: currentColor; } -#grid .grid > * { +#grids .grid > * { padding: calc(var(--spacing) / 2) 0; border-radius: var(--border-radius); background: var(--code-background-color); font-size: 87.5%; text-align: center; } -#grid details { +#grids details { margin-top: calc(var(--typography-spacing-vertical) * 2); } -#grid details svg { +#grids details svg { vertical-align: bottom; } @@ -274,17 +270,9 @@ main > aside details[open] > summary:not(:focus) { grid-row-gap: 0; } -#modal button { - --font-weight: bold; -} - /** * Docs: Typography */ -h1 { - margin-top: -0.25em; -} - section > hgroup { margin-bottom: calc(var(--typography-spacing-vertical) * 2); } @@ -309,14 +297,14 @@ article > footer.code { article pre, article pre code { - margin-bottom: 0; background: transparent; + margin-bottom: 0; } section > pre { + background: var(--article-code-background-color); margin: var(--block-spacing-vertical) 0; padding: calc(var(--block-spacing-vertical) / 1.5) var(--block-spacing-horizontal); - background: var(--article-code-background-color); box-shadow: var(--card-box-shadow); } @@ -359,37 +347,6 @@ section > pre { content: "Great"; } -/** - * Docs: Modal - */ -dialog.example { - display: block; - z-index: inherit; - position: relative; - top: inherit; - right: inherit; - bottom: inherit; - left: inherit; - align-items: inherit; - justify-content: inherit; - width: inherit; - min-width: inherit; - height: inherit; - min-height: inherit; - padding: 0; - background-color: inherit; -} -dialog.example article { - max-width: inherit; -} -dialog.example:not([open]), dialog.example[open=false] { - display: none; -} - -.dialog-is-open body > button { - filter: blur(0.125rem); -} - /** * Docs: Navs */ @@ -457,8 +414,8 @@ body > nav ul:first-of-type li:nth-of-type(2) { border: 0.15rem solid currentColor; border-radius: 50%; background: linear-gradient(to right, currentColor 0%, currentColor 50%, transparent 50%); - content: ""; vertical-align: bottom; + content: ""; transition: transform var(--transition); } .switcher i { @@ -466,8 +423,8 @@ body > nav ul:first-of-type li:nth-of-type(2) { max-width: 0; padding: 0; overflow: hidden; - font-style: normal; font-size: 0.875rem; + font-style: normal; white-space: nowrap; } .switcher:hover, .switcher:focus { @@ -490,5 +447,3 @@ body > nav ul:first-of-type li:nth-of-type(2) { right: calc(var(--spacing) + var(--scrollbar-width, 0px)); } } - -/*# sourceMappingURL=pico.docs.css.map */ \ No newline at end of file diff --git a/docs/customization.html b/docs/customization.html deleted file mode 100644 index d018a94c..00000000 --- a/docs/customization.html +++ /dev/null @@ -1,59 +0,0 @@ -Customization • Pico.css

Customization

You can customize themes with SCSS or, you can edit the CSS variables.

Example: pick a color!

Custom theme

// Simplified example
-:root {
-  --primary: ;
-}
-

There are 2 ways to customize your version of Pico.css:

Overriding CSS variables

All Pico's styles and colors are set with CSS custom properties (variables). Just override the CSS variables to customize your version of Pico.

/* Light scheme (Default) */
-/* Can be forced with data-theme="light" */
-[data-theme="light"],
-:root:not([data-theme="dark"]) {
-  --primary: ;
-  --primary-hover: ;
-  --primary-focus: ;
-  --primary-inverse: ;
-}
-
-/* Dark scheme (Auto) */
-/* Automatically enabled if user has Dark mode enabled */
-@media only screen and (prefers-color-scheme: dark) {
-  :root:not([data-theme="light"]) {
-    --primary: ;
-    --primary-hover: ;
-    --primary-focus: ;
-    --primary-inverse: ;
-  }
-}
-
-/* Dark scheme (Forced) */
-/* Enabled if forced with data-theme="dark" */
-[data-theme="dark"] {
-  --primary: ;
-  --primary-hover: ;
-  --primary-focus: ;
-  --primary-inverse: ;
-}
-
-/* (Common styles) */
-:root {
-  --form-element-active-border-color: var(--primary);
-  --form-element-focus-color: var(--primary-focus);
-  --switch-color: var(--primary-inverse);
-  --switch-checked-background-color: var(--primary);
-}
-

You can find all the CSS variables used in the default theme here: css/themes/default.css

Importing Pico SASS library

We recommend customizing Pico by importing SASS source files into your project. This way, you can keep Pico up to date without conflicts since Pico code and your custom code are separated.

Compile the SASS file to CSS to get a custom version of Pico.

/* Custom  version */
-
-// Override default variables
-$primary-500: ;
-$primary-600: ;
-$primary-700: ;
-
-// Import full Pico source code
-@import "path/pico";

Alternatively, you can create a custom theme and import it into your project with the components you need.

/* Custom  version */
-
-// Custom theme
-@import "path/themes/custom";
-
-// Import needed components
-@import "path/layout/document";
-@import "path/layout/sectioning";
-
-

Compiling a custom SASS version allows you to create a lighter version with only the components that are useful to you. Example here: scss/pico.slim.scss.

\ No newline at end of file diff --git a/docs/forms.html b/docs/forms.html deleted file mode 100644 index a8bd5be2..00000000 --- a/docs/forms.html +++ /dev/null @@ -1,93 +0,0 @@ -Forms • Pico.css

Forms

All form elements are fully responsive in pure semantic HTML, allowing forms to scale gracefully across devices and viewports.

Inputs are width: 100%; by default. You can use .grid inside a form.

All natives form elements are fully customizable and themeable with CSS variables.

We'll never share your email with anyone else.
<form>
-
-  <!-- Grid -->
-  <div class="grid">
-
-    <!-- Markup example 1: input is inside label -->
-    <label for="firstname">
-      First name
-      <input type="text" id="firstname" name="firstname" placeholder="First name" required>
-    </label>
-
-    <label for="lastname">
-      Last name
-      <input type="text" id="lastname" name="lastname" placeholder="Last name" required>
-    </label>
-
-  </div>
-
-  <!-- Markup example 2: input is after label -->
-  <label for="email">Email address</label>
-  <input type="email" id="email" name="email" placeholder="Email address" required>
-  <small>We'll never share your email with anyone else.</small>
-
-  <!-- Button -->
-  <button type="submit">Submit</button>
-
-</form>

Disabled and validation states:

<input type="text" placeholder="Valid" aria-invalid="false">
-<input type="text" placeholder="Invalid" aria-invalid="true">
-<input type="text" placeholder="Disabled" disabled>
-<input type="text" value="Readonly" readonly>

<fieldset> is unstyled and acts as a container for radios and checkboxes, providing a consistent margin-bottom for the set.

role="switch" on a type="checkbox" enable a custom switch.

Size
<!-- Select -->
-<label for="fruit">Fruit</label>
-<select id="fruit" required>
-  <option value="" selected>Select a fruit…</option>
-  <option>…</option>
-</select>
-
-<!-- Radios -->
-<fieldset>
-  <legend>Size</legend>
-  <label for="small">
-    <input type="radio" id="small" name="size" value="small" checked>
-    Small
-  </label>
-  <label for="medium">
-    <input type="radio" id="medium" name="size" value="medium">
-    Medium
-  </label>
-  <label for="large">
-    <input type="radio" id="large" name="size" value="large">
-    Large
-  </label>
-</fieldset>
-
-<!-- Checkbox -->
-<fieldset>
-  <label for="terms">
-    <input type="checkbox" id="terms" name="terms">
-    I agree to the Terms and Conditions
-  </label>
-</fieldset>
-
-<!-- Switch -->
-<fieldset>
-  <label for="switch">
-    <input type="checkbox" id="switch" name="switch" role="switch">
-    Publish on my profile
-  </label>
-</fieldset>

You can change a checkbox to an indeterminate state by setting the indeterminate property to true

<script>
-  document.getElementById('indeterminate-checkbox').indeterminate = true;
-</script>

Others input types:

<!-- File browser -->
-<label for="file">File browser
-  <input type="file" id="file" name="file">
-</label>
-
-<!-- Range slider -->
-<label for="range">Range slider
-  <input type="range" min="0" max="100" value="50" id="range" name="range">
-</label>
-
-<!-- Date -->
-<label for="date">Date
-  <input type="date" id="date" name="date">
-</label>
-
-<!-- Time -->
-<label for="time">Time
-  <input type="time" id="time" name="time">
-</label>
-
-<!-- Color -->
-<label for="color">Color
-  <input type="color" id="color" name="color" value="#0eaaaa">
-</label>
\ No newline at end of file diff --git a/docs/grid.html b/docs/grid.html deleted file mode 100644 index 7984f77b..00000000 --- a/docs/grid.html +++ /dev/null @@ -1,6 +0,0 @@ -Grid • Pico.css

Grid

.grid enable a minimal grid system with auto-layout columns.

1
2
3
4
<div class="grid">
-  <div>1</div>
-  <div>2</div>
-  <div>3</div>
-  <div>4</div>
-</div>

Columns intentionally collapses below large devices (992px)

To go further, discover how to merge Pico with the Bootstrap grid system.

 More about grids

As Pico focuses on native HTML elements, we kept this grid system very minimalist.

A complete grid system in flexbox, with all the ordering, offsetting and, breakpoints utilities, can be heavier than the total size of the Pico library. Not really in the Pico spirit.

If you need a quick way to prototyping or build a complex layout, you can look at Flexbox grid layouts. For example, Bootstrap Grid System only or Flexbox Grid.

If you need a light and custom grid, you can look at CSS Grid Generators. For example, CSS Grid Generator, Layoutit! or Griddy.

Alternatively, you can learn about CSS Grid.

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 6000a557..423b3de1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,125 @@ -Documentation • Pico.css

Usage

Works without package manager or dependencies 🙂!

There are 3 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">

Install from CDN

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

<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">

Install with NPM

npm install @picocss/pico

Starter HTML template:

<!doctype html>
+
+
+
+  
+    
+    
+    
+    Pico.css • Minimal CSS Framework for semantic HTML
+    
+    
+    
+  
+
+  
+
+    
+    
+
+    
+    
+ + + + + +
+ + +
+
+

Usage

+

Work without package manager or dependencies 🙂!

+
+

There are 3 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">
+

Install from CDN

+

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

+
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
+

Install with NPM

+
npm install @picocss/pico
+

Starter HTML template:

+ +
<!doctype html>
 <html lang="en">
   <head>
     <meta charset="utf-8">
@@ -11,4 +132,1202 @@
       <h1>Hello, world!</h1>
     </main>
   </body>
-</html>

Code licensed MIT

\ No newline at end of file +</html>
+ +
+ + +
+
+

Themes

+

Pico is shipped with 2 consistent themes: Light & Dark.

+
+

The Light theme is used by default. The Dark theme is automatically enabled if the user has dark mode enabled prefers-color-scheme: dark

+
+ +
+

Themes can be forced on document level <html data-theme="light"> or on any HTML element <article data-theme="dark">

+
+

Light theme

+
+ + + +
+
+ +
<article data-theme="light">
+  …
+</article>
+ +
+
+
+

Dark theme

+
+ + + +
+
+ +
<article data-theme="dark">
+  …
+</article>
+ +
+
+
+ + +
+
+

Customization

+

You can customize themes with SCSS or, you can edit the CSS variables.

+
+

Example: pick a color!

+ +
+

Custom theme

+
+
+ + + +
+
+ +
+
+
+ +
// Simplified example
+:root {
+  --primary: ;
+}
+
+ +
+
+

There are 2 ways to customize your version of Pico.css:

+

Overriding CSS variables

+

All Pico's styles and colors are set with CSS custom properties (variables). Just override the CSS variables to customize your version of Pico.

+ +
/* Light scheme (Default) */
+/* Can be forced with data-theme="light" */
+[data-theme="light"],
+:root:not([data-theme="dark"]) {
+  --primary: ;
+  --primary-hover: ;
+  --primary-focus: ;
+  --primary-inverse: ;
+}
+
+/* Dark scheme (Auto) */
+/* Automatically enabled if user has Dark mode enabled */
+@media only screen and (prefers-color-scheme: dark) {
+  :root:not([data-theme="light"]) {
+    --primary: ;
+    --primary-hover: ;
+    --primary-focus: ;
+    --primary-inverse: ;
+  }
+}
+
+/* Dark scheme (Forced) */
+/* Enabled if forced with data-theme="dark" */
+[data-theme="dark"] {
+  --primary: ;
+  --primary-hover: ;
+  --primary-focus: ;
+  --primary-inverse: ;
+}
+
+/* (Common styles) */
+:root {
+  --form-element-active-border-color: var(--primary);
+  --form-element-focus-color: var(--primary-focus);
+  --switch-color: var(--primary-inverse);
+  --switch-checked-background-color: var(--primary);
+}
+
+ +

You can find all the CSS variables used in the default theme here: css/themes/default.css

+

Importing Pico SASS library

+

We recommend customizing Pico by importing SASS source files into your project. This way, you can keep Pico up to date without conflicts since Pico code and your custom code are separated.

+

Compile the SASS file to CSS to get a custom version of Pico.

+ +
/* Custom  version */
+
+// Override default variables
+$primary-500: ;
+$primary-600: ;
+$primary-700: ;
+
+// Import full Pico source code
+@import "path/pico";
+ +

Alternatively, you can create a custom theme and import it into your project with the components you need.

+ +
/* Custom  version */
+
+// Custom theme
+@import "path/themes/custom";
+
+// Import needed components
+@import "path/layout/document";
+@import "path/layout/sectioning";
+
+
+ +

Compiling a custom SASS version allows you to create a lighter version with only the components that are useful to you. Example here: scss/pico.slim.scss.

+
+ + +
+
+

Class-less version

+

For wild HTML purists!

+
+

Pico provides a .classless version (example).

+

In this version, <header>, <main>, and <footer> act as containers to define a centered or a fluid viewport.

+

Usage:

+

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

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

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

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

These .classless versions are also available on unpkg CDN:

+ +
// Centered viewport
+<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.classless.min.css">
+
+ +
// Fluid viewport
+<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.fluid.classless.min.css">
+
+ +
+ + +
+
+

RTL

+

Support for right-to-left text in Pico.

+
+

To enable RTL in Pico you need to set dir="rtl"on the <html> element.

+ +
<!doctype html>
+<html dir="rtl" lang="ar">
+  ...
+</html>
+ +

The RTL feature is still experimental and will probably evolve.

+
+ + +
+
+

Containers

+

+ .container enable a centered viewport.
+ .container-fluid enable a 100% layout. +

+
+ +
<body>
+  <main class="container"></main>
+</body>
+ +

Pico uses the same breakpoints and viewports sizes as Bootstrap.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DeviceExtra smallSmallMediumLargeExtra large
Breakpoint<576px≥576px≥768px≥992px≥1200px
Viewport100%540px720px960px1140px
+
+

<header>, <main> and <footer> as direct childs of <body> provide a responsive vertical padding

+

<section> provide a responsive margin-bottom to separate your sections.

+
+ + +
+
+

Grids

+

.grid enable a minimal grid system with auto-layout columns.

+
+
+
+
1
+
2
+
3
+
4
+
+
+ +
<div class="grid">
+  <div>1</div>
+  <div>2</div>
+  <div>3</div>
+  <div>4</div>
+</div>
+ +
+
+

Columns intentionally collapses below large devices (992px)

+

To go further, discover how to merge Pico with the Bootstrap grid system.

+
+ + +  More about grids + +

As Pico focuses on native HTML elements, we kept this grid system very minimalist.

+

A complete grid system in flexbox, with all the ordering, offsetting and, breakpoints utilities, can be heavier than the total size of the Pico library. Not really in the Pico spirit.

+

If you need a quick way to prototyping or build a complex layout, you can look at Flexbox grid layouts. For example, Bootstrap Grid System only or Flexbox Grid.

+

If you need a light and custom grid, you can look at CSS Grid Generators. For example, CSS Grid Generator, Layoutit! or Griddy.

+

Alternatively, you can learn about CSS Grid.

+
+
+ + +
+
+

Horizontal scroller

+

<figure> acts as a container to make any content scrollable horizontally.

+
+

Useful to have responsive <table>

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#HeadingHeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading
1CellCellCellCellCellCellCellCellCell
2CellCellCellCellCellCellCellCellCell
3CellCellCellCellCellCellCellCellCell
+
+ +
<figure>
+  <table>
+    …
+  </table>
+</figure>
+ +
+ + +
+
+

Typography

+

All typographic elements are responsive, allowing text to scale gracefully across devices and viewports.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DeviceExtra smallSmallMediumLargeExtra large
Base font16px17px18px19px20px
<h1>32px34px36px38px40px
<h2>28px29px31.5px33.25px35px
<h3>24px25.5px27px28.5px30px
<h4>20px21.25px22.5px23.75px25px
<h5>18px19.125px20.25px21.375px22.5px
<h6>16px17px18px19px20px
<small>14px14.875px15.75px16.625px27.5px
+
+

Headings:

+
+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+
+ +
<h1>Heading 1</h1>
+<h2>Heading 2</h2>
+<h3>Heading 3</h3>
+<h4>Heading 4</h4>
+<h5>Heading 5</h5>
+<h6>Heading 6</h6>
+ +
+
+

Inside a <hgroup> all margin-bottom are collapsed and the :last-child is muted.

+
+
+

Heading 2

+

Subtitle for heading 2

+
+
+ +
<hgroup>
+  <h2>Heading 2</h2>
+  <h3>Subtitle for heading 2</h3>
+</hgroup>
+ +
+
+

Inline text elements:

+
+
+
+

Abbr. abbr

+

Bold strong b

+

Italic i em cite

+

Deleted del

+

Inserted ins

+

Ctrl + S kbd

+
+
+

Highlighted mark

+

Strikethrough s

+

Small small

+

Text Sub sub

+

Text Sup sup

+

Underline u

+
+
+
+

Links come with .secondary and .contrast styles.

+
+ Primary
+ Secondary
+ Contrast
+
+ +
<a href="#">Primary</a>
+<a href="#" class="secondary">Secondary</a>
+<a href="#" class="contrast">Contrast</a>
+ +
+
+

Blockquote:

+
+
+ "Maecenas vehicula metus tellus, vitae congue turpis hendrerit non. Nam at dui sit amet ipsum cursus ornare." +
+ - Phasellus eget lacinia +
+
+
+ +
<blockquote>
+  "Maecenas vehicula metus tellus, vitae congue turpis hendrerit non. Nam at dui sit amet ipsum cursus ornare."
+  <footer>
+    <cite>- Phasellus eget lacinia</cite>
+  </footer>
+</blockquote>
+ +
+
+
+ + +
+
+

Buttons

+

The essential button in pure HTML, without .classes for the default style.

+
+
+ + +
+ +
<button>Button</button>
+<input type="submit">
+ +
+
+

Buttons are width: 100%; by default. Use <a role="button"> if you need an inline element.

+
+ Link + Link +
+ +
<a href="#" role="button">Link</a>
+<a href="#" role="button">Link</a>
+ +
+
+

Buttons come with .secondary and .contrast styles.

+
+ Secondary + Contrast +
+ +
<a href="#" role="button" class="secondary">Secondary</a>
+<a href="#" role="button" class="contrast">Contrast</a>
+ +
+
+

And a classic .outline variant.

+
+ Primary + Secondary + Contrast +
+ +
<a href="#" role="button" class="outline">Primary</a>
+<a href="#" role="button" class="secondary outline">Secondary</a>
+<a href="#" role="button" class="contrast outline">Contrast</a>
+ +
+
+
+ + +
+
+

Forms

+

All form elements are fully responsive in pure semantic HTML, allowing forms to scale gracefully across devices and viewports.

+
+

Inputs are width: 100%; by default. You can use .grid inside a form.

+

All natives form elements are fully customizable and themeable with CSS variables.

+
+
+
+ + +
+ + + We'll never share your email with anyone else. + +
+
+ +
<form>
+
+  <!-- Grid -->
+  <div class="grid">
+
+    <!-- Markup example 1: input is inside label -->
+    <label for="firstname">
+      First name
+      <input type="text" id="firstname" name="firstname" placeholder="First name" required>
+    </label>
+
+    <label for="lastname">
+      Last name
+      <input type="text" id="lastname" name="lastname" placeholder="Last name" required>
+    </label>
+
+  </div>
+
+  <!-- Markup example 2: input is after label -->
+  <label for="email">Email address</label>
+  <input type="email" id="email" name="email" placeholder="Email address" required>
+  <small>We'll never share your email with anyone else.</small>
+
+  <!-- Button -->
+  <button type="submit">Submit</button>
+
+</form>
+ +
+
+

Disabled and validation states:

+
+
+ + + + +
+
+ +
<input type="text" placeholder="Valid" aria-invalid="false">
+<input type="text" placeholder="Invalid" aria-invalid="true">
+<input type="text" placeholder="Disabled" disabled>
+<input type="text" value="Readonly" readonly>
+ +
+
+

<fieldset> is unstyled and acts as a container for radios and checkboxes, providing a consistent margin-bottom for the set.

+

role="switch" on a type="checkbox" enable a custom switch.

+
+ + +
+ Size + + + +
+
+ +
+
+ +
+
+ +
<!-- Select -->
+<label for="fruit">Fruit</label>
+<select id="fruit" required>
+  <option value="" selected>Select a fruit…</option>
+  <option>…</option>
+</select>
+
+<!-- Radios -->
+<fieldset>
+  <legend>Size</legend>
+  <label for="small">
+    <input type="radio" id="small" name="size" value="small" checked>
+    Small
+  </label>
+  <label for="medium">
+    <input type="radio" id="medium" name="size" value="medium">
+    Medium
+  </label>
+  <label for="large">
+    <input type="radio" id="large" name="size" value="large">
+    Large
+  </label>
+</fieldset>
+
+<!-- Checkbox -->
+<fieldset>
+  <label for="terms">
+    <input type="checkbox" id="terms" name="terms">
+    I agree to the Terms and Conditions
+  </label>
+</fieldset>
+
+<!-- Switch -->
+<fieldset>
+  <label for="switch">
+    <input type="checkbox" id="switch" name="switch" role="switch">
+    Publish on my profile
+  </label>
+</fieldset>
+ +
+
+

You can change a checkbox to an indeterminate state by setting the indeterminate property to true

+
+ + +
+ +
<script>
+  document.getElementById('indeterminate-checkbox').indeterminate = true;
+</script>
+ +
+
+

Others input types:

+
+ + + + + +
+ +
<!-- File browser -->
+<label for="file">File browser
+  <input type="file" id="file" name="file">
+</label>
+
+<!-- Range slider -->
+<label for="range">Range slider
+  <input type="range" min="0" max="100" value="50" id="range" name="range">
+</label>
+
+<!-- Date -->
+<label for="date">Date
+  <input type="date" id="date" name="date">
+</label>
+
+<!-- Time -->
+<label for="time">Time
+  <input type="time" id="time" name="time">
+</label>
+
+<!-- Color -->
+<label for="color">Color
+  <input type="color" id="color" name="color" value="#0eaaaa">
+</label>
+ +
+
+
+ + +
+
+

Tables

+

Default styles for tables without .classes

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#HeadingHeadingHeadingHeadingHeading
1CellCellCellCellCell
2CellCellCellCellCell
3CellCellCellCellCell
+
+ +
<table>
+  <thead>
+    <tr>
+      <th scope="col">#</th>
+      <th scope="col">Heading</th>
+      <th scope="col">Heading</th>
+      <th scope="col">Heading</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <th scope="row">1</th>
+      <td>Cell</td>
+      <td>Cell</td>
+      <td>Cell</td>
+    </tr>
+  </tbody>
+</table>
+ +

role="grid" enable striped rows.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#HeadingHeadingHeadingHeadingHeading
1CellCellCellCellCell
2CellCellCellCellCell
3CellCellCellCellCell
+
+ +
<table role="grid">
+  
+</table>
+ +
+ + +
+
+

Accordions

+

Toggle sections of content in pure HTML, without JavaScript.

+
+
+
+ Collapsible elements 1 +

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.

+
+
+ Collapsible elements 2 +
    +
  • Vestibulum id elit quis massa interdum sodales.
  • +
  • Nunc quis eros vel odio pretium tincidunt nec quis neque.
  • +
  • Quisque sed eros non eros ornare elementum.
  • +
  • Cras sed libero aliquet, porta dolor quis, dapibus ipsum.
  • +
+
+
+ +
<details>
+  <summary>Collapsible elements 1</summary>
+  <p>…</p>
+</details>
+
+<details open>
+  <summary>Collapsible elements 2</summary>
+  <ul>
+    <li>…</li>
+    <li>…</li>
+  </ul>
+</details>
+ +
+
+
+ + +
+
+

Cards

+

A flexible container with graceful spacings across devices and viewports.

+
+
+ I'm a card! +
+
<article>I'm a card!</article>
+

You can use <header> and footer <footer> inside <article>

+
+
Header
+ Body +
Footer
+
+ +
<article>
+  <header>Header</header>
+  Body
+  <footer>Footer</footer>
+</article>
+ +
+ + + + + +
+
+

Progress

+

Progress bar element in pure HTML, without JavaScript.

+
+
+ +
+ +
<progress value="25" max="100"></progress>
+ +
+
+

You can change a progress bar to an indeterminate state by setting the indeterminate property to true

+
+ + +
+ +
<script>
+  document.getElementById('indeterminate-progress').indeterminate = true;
+</script>
+ +
+
+
+ + +
+
+

Loading

+

aria-busy="true" enable a loading indicator.

+
+
+ + +
+ +
<button aria-busy="true">Please wait…</button>
+<button aria-busy="true" class="secondary"></button>
+ +
+
+

It can be applied to any block:

+
+
<article aria-busy="true"></article>
+

Or any text element:

+ +
+ + +
+
+

Tooltips

+

Enable tooltips everywhere in pure HTML, without JavaScript.

+
+
+

Tooltip on a link

+

Tooltip on inline element

+

+
+ +
<p>Tooltip on a <a href="#" data-tooltip="Tooltip">link</a></p>
+<p>Tooltip on <em data-tooltip="Tooltip">inline element</em></p>
+<p><button data-tooltip="Tooltip">Tooltip on a button</button></p>
+ +
+
+
+ + +
+

We love .classes

+

As a starting point, Pico chose to be as neutral and semantic as possible using very few .classes

+

But of course, .classes are not a bad practice at all.

+

Feel free to use modifiers.

+
+
<button class="warning">Action</button>
+
+

Just try to keep your HTML clean and semantic to keep the Pico spirit.

+
+
<button class="button-red margin-large padding-medium">Action</button>
+
+
+ + +
+
+

Code licensed MIT

+
+ +
+ +
+ + + + + + + + diff --git a/docs/js/commons.js b/docs/js/commons.js deleted file mode 100644 index 630081af..00000000 --- a/docs/js/commons.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Add some magic to Pico docs - * - * Pico.css - https://picocss.com - * Copyright 2019-2021 - Licensed under MIT - */ - -// Imports -import themeSwitcher from './src/theme-switcher.js'; -import toggleNavigation from './src/toggle-navigation'; - -// Theme switcher -themeSwitcher.addButton({ - tag: 'BUTTON', - class: 'contrast switcher theme-switcher', - target: 'body', -}); -themeSwitcher.init(); - -// Toggle navigation -toggleNavigation.init(); \ No newline at end of file diff --git a/docs/js/commons.min.js b/docs/js/commons.min.js deleted file mode 100644 index 0be9d3b5..00000000 --- a/docs/js/commons.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";!function(){var e={_scheme:"auto",change:{light:"Turn on dark mode",dark:"Turn off dark mode"},buttonsTarget:".theme-switcher",init:function(){this.scheme=this._scheme,this.initSwitchers()},get preferedColorScheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},initSwitchers:function(){var t=this;document.querySelectorAll(this.buttonsTarget).forEach(function(e){e.addEventListener("click",function(){"dark"==t.scheme?t.scheme="light":t.scheme="dark"},!1)})},addButton:function(e){var t=document.createElement(e.tag);t.className=e.class,document.querySelector(e.target).appendChild(t)},set scheme(e){"auto"==e?"dark"==this.preferedColorScheme?this._scheme="dark":this._scheme="light":"dark"!=e&&"light"!=e||(this._scheme=e),this.applyScheme()},get scheme(){return this._scheme},applyScheme:function(){var i=this;document.querySelector("html").setAttribute("data-theme",this.scheme),document.querySelectorAll(this.buttonsTarget).forEach(function(e){var t="dark"==i.scheme?i.change.dark:i.change.light;e.innerHTML=t,e.setAttribute("aria-label",t.replace(/<[^>]*>?/gm,""))})}},t={_state:"closed-on-mobile",toggleLink:document.getElementById("toggle-docs-navigation"),nav:document.querySelector("main > aside > nav"),init:function(){this.onToggleClick()},onToggleClick:function(){var t=this;this.toggleLink.addEventListener("click",function(e){e.preventDefault(),"closed-on-mobile"==t.state?t.state="open":t.state="closed-on-mobile",t.nav.removeAttribute("class"),t.nav.classList.add(t.state)},!1)},get state(){return this._state},set state(e){this._state=e}};e.addButton({tag:"BUTTON",class:"contrast switcher theme-switcher",target:"body"}),e.init(),t.init()}(); \ No newline at end of file diff --git a/docs/js/customization.js b/docs/js/customization.js deleted file mode 100644 index 32f23f4e..00000000 --- a/docs/js/customization.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Customization - * - * Pico.css - https://picocss.com - * Copyright 2019-2021 - Licensed under MIT - */ - -// Imports -import materialDesignColors from './src/material-design-colors.js'; -import colorPicker from './src/color-picker.js'; - -// Color Picker -colorPicker.colors = materialDesignColors; -colorPicker.init(); \ No newline at end of file diff --git a/docs/js/customization.min.js b/docs/js/customization.min.js deleted file mode 100644 index c62202eb..00000000 --- a/docs/js/customization.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";!function(){var e={colors:null,buttonsTarget:'#customization article[data-theme="generated"]',selectorButton:"#customization button[data-color]",selectorSection:"#customization",buttons:null,generatedStyles:null,init:function(){this.generateButtons(),this.setActiveButton("pink"),this.generateTheme("pink")},generateButtons:function(){var e,a=this,f="",t="";for(e in this.colors)f+=''),t+='\n button[data-color="'.concat(e,'"] {\n background-color: ').concat(this.colors[e][600],';\n }\n [data-theme="light"] button[data-color="').concat(e,'"]:hover,\n [data-theme="light"] button[data-color="').concat(e,'"]:active,\n [data-theme="light"] button[data-color="').concat(e,'"]:focus {\n background-color: ').concat(this.colors[e][700],'; \'\n }\n [data-theme="dark"] button[data-color="').concat(e,'"]:hover,\n [data-theme="dark"] button[data-color="').concat(e,'"]:active,\n [data-theme="dark"] button[data-color="').concat(e,'"]:focus {\n background-color: ').concat(this.colors[e][500],";\n }");var c=document.createElement("FIGURE");c.innerHTML=f,document.querySelector(this.buttonsTarget).before(c),this.buttons=document.querySelectorAll(this.selectorButton),this.buttons.forEach(function(e){e.addEventListener("click",function(e){e=e.target.getAttribute("data-color");a.setActiveButton(e),a.generateTheme(e)},!1)});c=document.createElement("STYLE");c.setAttribute("title","color-picker"),this.generatedStyles=this.minifyCSS(t),c.innerHTML=this.generatedStyles,document.querySelector("head").appendChild(c)},setActiveButton:function(e){this.buttons.forEach(function(e){e.removeAttribute("class")}),document.querySelector(this.selectorButton+'[data-color="'+e+'"]').setAttribute("class","picked")},generateTheme:function(e){var f=this,a=e,e=this.colors[e],t={".name":a.charAt(0).toUpperCase()+a.substring(1)+" ",".c500":e[500],".c600":e[600],".c700":e[700],".c600-outline-light":this.hexToRgbA(e[600],.125),".c600-outline-dark":this.hexToRgbA(e[600],.25),".inverse":e.inverse};Object.keys(t).forEach(function(a){document.querySelectorAll(f.selectorSection+" "+a).forEach(function(e){e.innerHTML=t[a]})});e='\n [data-theme="generated"] {\n --h4-color: '.concat(e[700],";\n --primary: ").concat(e[600],";\n --primary-hover: ").concat(e[700],";\n --primary-focus: ").concat(this.hexToRgbA(e[600],.125),";\n --primary-inverse: ").concat(e.inverse,';\n }\n @media only screen and (prefers-color-scheme: dark) {\n :root:not([data-theme="light"]) [data-theme="generated"] {\n --h4-color: ').concat(e[400],";\n --primary: ").concat(e[600],";\n --primary-hover: ").concat(e[500],";\n --primary-focus: ").concat(this.hexToRgbA(e[600],.25),";\n --primary-inverse: ").concat(e.inverse,';\n }\n }\n [data-theme="dark"] [data-theme="generated"] {\n --h4-color: ').concat(e[500],";\n --primary: ").concat(e[600],";\n --primary-hover: ").concat(e[500],";\n --primary-focus: ").concat(this.hexToRgbA(e[600],.25),";\n --primary-inverse: ").concat(e.inverse,';\n }\n [data-theme="generated"] {\n --form-element-active-border-color: var(--primary);\n --form-element-focus-color: var(--primary-focus);\n --switch-color: var(--primary-inverse);\n --switch-checked-background-color: var(--primary);\n }');document.querySelector('style[title="color-picker"]').innerHTML=this.generatedStyles+this.minifyCSS(e)},minifyCSS:function(e){return e.replace(/^ +/gm,"")},hexToRgbA:function(e,a){if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(e))return"rgba("+[(e="0x"+(e=3==(e=e.substring(1).split("")).length?[e[0],e[0],e[1],e[1],e[2],e[2]]:e).join(""))>>16&255,e>>8&255,255&e].join(", ")+", "+a+")";throw new Error("Bad Hex")}};e.colors={red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000",inverse:"#FFF"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162",inverse:"#FFF"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff",inverse:"#FFF"},"deep-purple":{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea",inverse:"#FFF"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe",inverse:"#FFF"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff",inverse:"#FFF"},"light-blue":{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea",inverse:"#FFF"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4",inverse:"#FFF"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5",inverse:"#FFF"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853",inverse:"#FFF"},"light-green":{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17",inverse:"#FFF"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00",inverse:"rgba(0, 0, 0, 0.75)"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600",inverse:"rgba(0, 0, 0, 0.75)"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00",inverse:"rgba(0, 0, 0, 0.75)"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00",inverse:"#FFF"},"deep-orange":{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00",inverse:"#FFF"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",inverse:"#FFF"},"blue-grey":{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",inverse:"#FFF"}},e.init()}(); \ No newline at end of file diff --git a/docs/js/grid.min.js b/docs/js/grid.min.js deleted file mode 100644 index 49fb811b..00000000 --- a/docs/js/grid.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var grid={buttons:{text:{add:"Add column",remove:"Remove column"},target:"#grid article"},grid:{current:4,min:1,max:12,gridTarget:"#grid .grid",codeTarget:"#grid pre code"},init:function(){this.addButtons(),this.generateGrid()},addButtons:function(){var t=this,e=document.createElement("P");e.innerHTML='\n \n\n "),document.querySelector(this.buttons.target).before(e),document.querySelector("#grid button.add").addEventListener("click",function(){t.addColumn()},!1),document.querySelector("#grid button.remove").addEventListener("click",function(){t.removeColumn()},!1)},generateGrid:function(){for(var t="",e='<div class="grid">\n',n=0;n"+(n+1)+"",e+=" <div>"+(n+1)+"</div>\n";e+="</div>",document.querySelector(this.grid.gridTarget).innerHTML=t,document.querySelector(this.grid.codeTarget).innerHTML=e},addColumn:function(){this.grid.currentthis.grid.min&&(this.grid.current--,this.generateGrid())}};grid.init(); \ No newline at end of file diff --git a/docs/js/pico.docs.js b/docs/js/pico.docs.js new file mode 100644 index 00000000..a0123513 --- /dev/null +++ b/docs/js/pico.docs.js @@ -0,0 +1,35 @@ +/* + * Add some magic to Pico docs + * + * Pico.css - https://picocss.com + * Copyright 2019-2021 - Licensed under MIT + */ + +// Imports +import aside from './src/aside.js'; +import themeSwitcher from './src/theme-switcher.js'; +import materialDesignColors from './src/material-design-colors.js'; +import colorPicker from './src/color-picker.js'; +import grid from './src/grid.js'; +import scrollspy from './src/scrollspy.js'; + +// Aside initial state +aside.init(); + +// Theme switcher +themeSwitcher.addButton({ + tag: 'BUTTON', + class: 'contrast switcher theme-switcher', + target: 'body', +}); +themeSwitcher.init(); + +// Color Picker +colorPicker.colors = materialDesignColors; +colorPicker.init(); + +// Grid Interaction +grid.init(); + +// Scrollspy +scrollspy.init(); diff --git a/docs/js/pico.docs.min.js b/docs/js/pico.docs.min.js new file mode 100644 index 00000000..b481939e --- /dev/null +++ b/docs/js/pico.docs.min.js @@ -0,0 +1 @@ +"use strict";!function(){var e={minWidth:"992px",targets:{nav:"aside nav",details:"aside details"},init:function(){var e,t;window.matchMedia("(min-width: "+this.minWidth+")").matches&&(e=document.querySelector(this.targets.nav),t=document.querySelectorAll(this.targets.details),e.clientHeightTurn on dark mode",dark:"Turn off dark mode"},buttonsTarget:".theme-switcher",init:function(){this.scheme=this._scheme,this.initSwitchers()},get preferedColorScheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},initSwitchers:function(){document.querySelectorAll(this.buttonsTarget).forEach(function(e){e.addEventListener("click",function(e){"dark"==this.scheme?this.scheme="light":this.scheme="dark"}.bind(this),!1)}.bind(this))},addButton:function(e){var t=document.createElement(e.tag);t.className=e.class,document.querySelector(e.target).appendChild(t)},set scheme(e){"auto"==e?"dark"==this.preferedColorScheme?this._scheme="dark":this._scheme="light":"dark"!=e&&"light"!=e||(this._scheme=e),this.applyScheme()},get scheme(){return this._scheme},applyScheme:function(){var t;document.querySelector("html").setAttribute("data-theme",this.scheme),document.querySelectorAll(this.buttonsTarget).forEach(function(e){t="dark"==this.scheme?this.change.dark:this.change.light,e.innerHTML=t,e.setAttribute("aria-label",t.replace(/<[^>]*>?/gm,""))}.bind(this))}},a={colors:null,buttonsTarget:'#customization article[data-theme="generated"]',selectorButton:"#customization button[data-color]",selectorSection:"#customization",buttons:null,generatedStyles:null,init:function(){this.generateButtons(),this.setActiveButton("pink"),this.generateTheme("pink")},generateButtons:function(){var e,t="",a="";for(e in this.colors)t+='',a+='\n button[data-color="'.concat(e,'"] {\n background-color: ').concat(this.colors[e][600],';\n }\n [data-theme="light"] button[data-color="').concat(e,'"]:hover,\n [data-theme="light"] button[data-color="').concat(e,'"]:active,\n [data-theme="light"] button[data-color="').concat(e,'"]:focus {\n background-color: ').concat(this.colors[e][700],'; \'\n }\n [data-theme="dark"] button[data-color="').concat(e,'"]:hover,\n [data-theme="dark"] button[data-color="').concat(e,'"]:active,\n [data-theme="dark"] button[data-color="').concat(e,'"]:focus {\n background-color: ').concat(this.colors[e][500],";\n }");var n=document.createElement("FIGURE");n.innerHTML=t,document.querySelector(this.buttonsTarget).before(n),this.buttons=document.querySelectorAll(this.selectorButton),this.buttons.forEach(function(e){e.addEventListener("click",function(e){e=e.target.getAttribute("data-color");this.setActiveButton(e),this.generateTheme(e)}.bind(this),!1)}.bind(this));n=document.createElement("STYLE");n.setAttribute("title","color-picker"),this.generatedStyles=this.minifyCSS(a),n.innerHTML=this.generatedStyles,document.querySelector("head").appendChild(n)},setActiveButton:function(e){this.buttons.forEach(function(e){e.removeAttribute("class")}.bind(this)),document.querySelector(this.selectorButton+'[data-color="'+e+'"]').setAttribute("class","picked")},generateTheme:function(e){var t=e,e=this.colors[e],a={".name":t.charAt(0).toUpperCase()+t.substring(1)+" ",".c500":e[500],".c600":e[600],".c700":e[700],".c600-outline-light":this.hexToRgbA(e[600],.125),".c600-outline-dark":this.hexToRgbA(e[600],.25),".inverse":e.inverse};Object.keys(a).forEach(function(t){document.querySelectorAll(this.selectorSection+" "+t).forEach(function(e){e.innerHTML=a[t]}.bind(this))}.bind(this));e='\n [data-theme="generated"] {\n --h4-color: '.concat(e[700],";\n --primary: ").concat(e[600],";\n --primary-hover: ").concat(e[700],";\n --primary-focus: ").concat(this.hexToRgbA(e[600],.125),";\n --primary-inverse: ").concat(e.inverse,';\n }\n @media only screen and (prefers-color-scheme: dark) {\n :root:not([data-theme="light"]) [data-theme="generated"] {\n --h4-color: ').concat(e[400],";\n --primary: ").concat(e[600],";\n --primary-hover: ").concat(e[500],";\n --primary-focus: ").concat(this.hexToRgbA(e[600],.25),";\n --primary-inverse: ").concat(e.inverse,';\n }\n }\n [data-theme="dark"] [data-theme="generated"] {\n --h4-color: ').concat(e[500],";\n --primary: ").concat(e[600],";\n --primary-hover: ").concat(e[500],";\n --primary-focus: ").concat(this.hexToRgbA(e[600],.25),";\n --primary-inverse: ").concat(e.inverse,';\n }\n [data-theme="generated"] {\n --form-element-active-border-color: var(--primary);\n --form-element-focus-color: var(--primary-focus);\n --switch-color: var(--primary-inverse);\n --switch-checked-background-color: var(--primary);\n }');document.querySelector('style[title="color-picker"]').innerHTML=this.generatedStyles+this.minifyCSS(e)},minifyCSS:function(e){return e.replace(/^ +/gm,"")},hexToRgbA:function(e,t){if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(e))return"rgba("+[(e="0x"+(e=3==(e=e.substring(1).split("")).length?[e[0],e[0],e[1],e[1],e[2],e[2]]:e).join(""))>>16&255,e>>8&255,255&e].join(", ")+", "+t+")";throw new Error("Bad Hex")}},n={buttons:{text:{add:"Add column",remove:"Remove column"},target:"#grids article"},grid:{current:4,min:1,max:12,gridTarget:"#grids .grid",codeTarget:"#grids pre code"},init:function(){this.addButtons(),this.generateGrid()},addButtons:function(){var e=document.createElement("P");e.innerHTML='\n \n\n "),document.querySelector(this.buttons.target).before(e),document.querySelector("#grids button.add").addEventListener("click",function(){this.addColumn()}.bind(this),!1),document.querySelector("#grids button.remove").addEventListener("click",function(){this.removeColumn()}.bind(this),!1)},generateGrid:function(){for(var e="",t='<div class="grid">\n',a=0;a"+(a+1)+"",t+=" <div>"+(a+1)+"</div>\n";t+="</div>",document.querySelector(this.grid.gridTarget).innerHTML=e,document.querySelector(this.grid.codeTarget).innerHTML=t},addColumn:function(){this.grid.currentthis.grid.min&&(this.grid.current--,this.generateGrid())}},i={minWidth:"992px",interval:75,targets:{sections:'[role="document"] > section',nav:"main aside nav",active:"active"},init:function(){window.matchMedia("(min-width: "+this.minWidth+")").matches&&(this.setActiveNav(),this.scrollStop())},setActiveNav:function(){var e=mostVisible(this.targets.sections).getAttribute("id");document.querySelectorAll(this.targets.nav+" a."+this.targets.active).forEach(function(e){e.classList.remove(this.targets.active)}.bind(this));e=document.querySelector(this.targets.nav+' a[href="#'+e+'"]');e.classList.add(this.targets.active),e.closest("details").setAttribute("open","")},scrollStop:function(){var t;window.addEventListener("scroll",function(e){window.clearTimeout(t),t=setTimeout(function(){this.setActiveNav()}.bind(this),this.interval)}.bind(this),!1)}};e.init(),t.addButton({tag:"BUTTON",class:"contrast switcher theme-switcher",target:"body"}),t.init(),a.colors={red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000",inverse:"#FFF"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162",inverse:"#FFF"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff",inverse:"#FFF"},"deep-purple":{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea",inverse:"#FFF"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe",inverse:"#FFF"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff",inverse:"#FFF"},"light-blue":{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea",inverse:"#FFF"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4",inverse:"#FFF"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5",inverse:"#FFF"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853",inverse:"#FFF"},"light-green":{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17",inverse:"#FFF"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00",inverse:"rgba(0, 0, 0, 0.75)"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600",inverse:"rgba(0, 0, 0, 0.75)"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00",inverse:"rgba(0, 0, 0, 0.75)"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00",inverse:"#FFF"},"deep-orange":{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00",inverse:"#FFF"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",inverse:"#FFF"},"blue-grey":{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",inverse:"#FFF"}},a.init(),n.init(),i.init()}(); \ No newline at end of file diff --git a/docs/js/src/aside.js b/docs/js/src/aside.js new file mode 100644 index 00000000..e784b7fd --- /dev/null +++ b/docs/js/src/aside.js @@ -0,0 +1,30 @@ +/* + * Aside adjustment + * + * Pico.css - https://picocss.com + * Copyright 2019-2021 - Licensed under MIT + */ + +export const aside = { + // Config + minWidth: '992px', + targets: { + nav: 'aside nav', + details: 'aside details', + }, + + // Init + init() { + if (window.matchMedia('(min-width: ' + this.minWidth + ')').matches) { + let nav = document.querySelector(this.targets.nav); + let details = document.querySelectorAll(this.targets.details); + if (nav.clientHeight < nav.scrollHeight) { + details.forEach(function (detail) { + detail.removeAttribute('open'); + }); + } + } + }, +}; + +export default aside; diff --git a/docs/js/src/color-picker.js b/docs/js/src/color-picker.js index 6842e42f..39ec3cec 100644 --- a/docs/js/src/color-picker.js +++ b/docs/js/src/color-picker.js @@ -6,7 +6,6 @@ */ export const colorPicker = { - // Config colors: null, buttonsTarget: '#customization article[data-theme="generated"]', @@ -31,7 +30,12 @@ export const colorPicker = { // Loop colors for (const color in this.colors) { // Buttons - innerButtons += ``; + innerButtons += + ''; // Styles innerStyles += ` @@ -57,13 +61,19 @@ export const colorPicker = { // Buttons listeners this.buttons = document.querySelectorAll(this.selectorButton); - this.buttons.forEach( button => { - button.addEventListener('click', event => { - let color = event.target.getAttribute('data-color'); - this.setActiveButton(color); - this.generateTheme(color); - }, false); - }); + this.buttons.forEach( + function (button) { + button.addEventListener( + 'click', + function (event) { + let color = event.target.getAttribute('data-color'); + this.setActiveButton(color); + this.generateTheme(color); + }.bind(this), + false + ); + }.bind(this) + ); // Insert CSS Styles let containerStyles = document.createElement('STYLE'); @@ -76,12 +86,16 @@ export const colorPicker = { // Set active button setActiveButton(color) { // Remove all active states - this.buttons.forEach( button => { - button.removeAttribute('class'); - }); + this.buttons.forEach( + function (button) { + button.removeAttribute('class'); + }.bind(this) + ); // Set active state - let buttonPicked = document.querySelector(this.selectorButton + '[data-color="' + color + '"]'); + let buttonPicked = document.querySelector( + this.selectorButton + '[data-color="' + color + '"]' + ); buttonPicked.setAttribute('class', 'picked'); }, @@ -101,12 +115,18 @@ export const colorPicker = { '.inverse': data['inverse'], }; - Object.keys(swaps).forEach( swap => { - let targets = document.querySelectorAll(this.selectorSection + ' ' + swap); - targets.forEach( target => { - target.innerHTML = swaps[swap]; - }); - }); + Object.keys(swaps).forEach( + function (swap) { + let targets = document.querySelectorAll( + this.selectorSection + ' ' + swap + ); + targets.forEach( + function (target) { + target.innerHTML = swaps[swap]; + }.bind(this) + ); + }.bind(this) + ); // 2. Update CSS Styles const innerStyles = ` diff --git a/docs/js/grid.js b/docs/js/src/grid.js similarity index 81% rename from docs/js/grid.js rename to docs/js/src/grid.js index 938d6fb9..4d9dd597 100644 --- a/docs/js/grid.js +++ b/docs/js/src/grid.js @@ -1,26 +1,25 @@ /* - * Grid + * Grid Interaction * * Pico.css - https://picocss.com * Copyright 2019-2021 - Licensed under MIT */ -const grid = { - +export const grid = { // Config buttons: { text: { add: 'Add column', remove: 'Remove column', }, - target: '#grid article', + target: '#grids article', }, grid: { current: 4, min: 1, max: 12, - gridTarget: '#grid .grid', - codeTarget: '#grid pre code', + gridTarget: '#grids .grid', + codeTarget: '#grids pre code', }, // Init @@ -51,14 +50,22 @@ const grid = { document.querySelector(this.buttons.target).before(buttons); // Add button listener - document.querySelector('#grid button.add').addEventListener('click', () => { - this.addColumn(); - }, false); + document.querySelector('#grids button.add').addEventListener( + 'click', + function () { + this.addColumn(); + }.bind(this), + false + ); // Remove button listener - document.querySelector('#grid button.remove').addEventListener('click', () => { - this.removeColumn(); - }, false); + document.querySelector('#grids button.remove').addEventListener( + 'click', + function () { + this.removeColumn(); + }.bind(this), + false + ); }, // Generate grid @@ -96,5 +103,4 @@ const grid = { }, }; -// Init -grid.init(); \ No newline at end of file +export default grid; diff --git a/docs/js/src/scrollspy.js b/docs/js/src/scrollspy.js new file mode 100644 index 00000000..8b12f1a6 --- /dev/null +++ b/docs/js/src/scrollspy.js @@ -0,0 +1,74 @@ +/* + * Scrollspy + * Automatically update nav targets based on scroll position + * + * Require `most-visible.js` (https://github.com/andyexeter/most-visible) + * + * Pico.css - https://picocss.com + * Copyright 2019-2021 - Licensed under MIT + */ + +export const scrollspy = { + + // Config + minWidth: '992px', + interval: 75, + targets: { + sections: '[role="document"] > section', + nav: 'main aside nav', + active: 'active', + }, + + // Init + init() { + if (window.matchMedia('(min-width: ' + this.minWidth + ')').matches) { + this.setActiveNav(); + this.scrollStop(); + } + }, + + // Set active section in nav + setActiveNav() { + // Get active section + let currentSection = mostVisible(this.targets.sections).getAttribute('id'); + + // Remove all active states + let links = document.querySelectorAll( + this.targets.nav + ' a.' + this.targets.active + ); + links.forEach( + function (link) { + link.classList.remove(this.targets.active); + }.bind(this) + ); + + // Set active state + let activeLink = document.querySelector( + this.targets.nav + ' a[href="#' + currentSection + '"]' + ); + activeLink.classList.add(this.targets.active); + + // Open details parent + activeLink.closest('details').setAttribute('open', ''); + }, + + // Scroll stop + scrollStop() { + let isScrolling; + window.addEventListener( + 'scroll', + function (event) { + window.clearTimeout(isScrolling); + isScrolling = setTimeout( + function () { + this.setActiveNav(); + }.bind(this), + this.interval + ); + }.bind(this), + false + ); + }, +}; + +export default scrollspy; diff --git a/docs/js/src/theme-switcher.js b/docs/js/src/theme-switcher.js index bb872cae..d8495a0c 100644 --- a/docs/js/src/theme-switcher.js +++ b/docs/js/src/theme-switcher.js @@ -6,7 +6,6 @@ */ export const themeSwitcher = { - // Config _scheme: 'auto', change: { @@ -23,21 +22,36 @@ export const themeSwitcher = { // Prefered color scheme get preferedColorScheme() { - return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; + if (window.matchMedia('(prefers-color-scheme: dark)').matches) { + return 'dark'; + } else { + return 'light'; + } }, // Init switchers initSwitchers() { const buttons = document.querySelectorAll(this.buttonsTarget); - buttons.forEach(button => { - button.addEventListener('click', () => { - this.scheme == 'dark' ? this.scheme = 'light' : this.scheme = 'dark'; - }, false); - }); + buttons.forEach( + function (button) { + button.addEventListener( + 'click', + function (event) { + if (this.scheme == 'dark') { + this.scheme = 'light'; + } else { + this.scheme = 'dark'; + } + }.bind(this), + false + ); + }.bind(this) + ); }, // Add new button addButton(config) { + // Insert Switcher let button = document.createElement(config.tag); button.className = config.class; document.querySelector(config.target).appendChild(button); @@ -46,11 +60,19 @@ export const themeSwitcher = { // Set scheme set scheme(scheme) { if (scheme == 'auto') { - this.preferedColorScheme == 'dark' ? this._scheme = 'dark' : this._scheme = 'light'; + if (this.preferedColorScheme == 'dark') { + this._scheme = 'dark'; + } else { + this._scheme = 'light'; + } } + + // Set to Dark else if (scheme == 'dark' || scheme == 'light') { this._scheme = scheme; } + + // Set to Apply theme this.applyScheme(); }, @@ -61,14 +83,22 @@ export const themeSwitcher = { // Apply scheme applyScheme() { + // Root attribute document.querySelector('html').setAttribute('data-theme', this.scheme); + + // Buttons text const buttons = document.querySelectorAll(this.buttonsTarget); + let text; buttons.forEach( - button => { - const text = this.scheme == 'dark' ? this.change.dark : this.change.light; + function (button) { + if (this.scheme == 'dark') { + text = this.change.dark; + } else { + text = this.change.light; + } button.innerHTML = text; button.setAttribute('aria-label', text.replace(/<[^>]*>?/gm, '')); - } + }.bind(this) ); }, }; diff --git a/docs/js/src/toggle-navigation.js b/docs/js/src/toggle-navigation.js deleted file mode 100644 index f51b76fb..00000000 --- a/docs/js/src/toggle-navigation.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Toggle navigation - * - * Pico.css - https://picocss.com - * Copyright 2019-2021 - Licensed under MIT - */ - -export const toggleNavigation = { - - // Config - _state: 'closed-on-mobile', - toggleLink: document.getElementById('toggle-docs-navigation'), - nav: document.querySelector('main > aside > nav'), - - // Init - init() { - this.onToggleClick() - }, - - onToggleClick() { - this.toggleLink.addEventListener('click', event => { - event.preventDefault(); - this.state == 'closed-on-mobile' - ? this.state = 'open' - : this.state = 'closed-on-mobile'; - this.nav.removeAttribute('class'); - this.nav.classList.add(this.state); - }, false); - }, - - // Get state - get state() { - return this._state; - }, - - // Set state - set state(state) { - this._state = state; - }, -}; - -export default toggleNavigation; \ No newline at end of file diff --git a/docs/loading.html b/docs/loading.html deleted file mode 100644 index 1647616e..00000000 --- a/docs/loading.html +++ /dev/null @@ -1,2 +0,0 @@ -Loading • Pico.css

Loading

aria-busy="true" enable a loading indicator.

<button aria-busy="true">Please wait…</button>
-<button aria-busy="true" class="secondary"></button>

It can be applied to any block:

<article aria-busy="true"></article>

Or any text element:


Code licensed MIT

\ No newline at end of file diff --git a/docs/navs.html b/docs/navs.html deleted file mode 100644 index 1c23873e..00000000 --- a/docs/navs.html +++ /dev/null @@ -1,28 +0,0 @@ -Navs • Pico.css

Code licensed MIT

\ No newline at end of file diff --git a/docs/progress.html b/docs/progress.html deleted file mode 100644 index 2452cd34..00000000 --- a/docs/progress.html +++ /dev/null @@ -1,3 +0,0 @@ -Progress • Pico.css

Progress

Progress bar element in pure HTML, without JavaScript.

<progress value="25" max="100"></progress>

You can change a progress bar to an indeterminate state by setting the indeterminate property to true

<script>
-  document.getElementById('indeterminate-progress').indeterminate = true;
-</script>

Code licensed MIT

\ No newline at end of file diff --git a/docs/rtl.html b/docs/rtl.html deleted file mode 100644 index 646406c8..00000000 --- a/docs/rtl.html +++ /dev/null @@ -1,4 +0,0 @@ -RTL (Right-To-Left) • Pico.css

RTL

Support for right-to-left text in Pico.

To enable RTL in Pico you need to set dir="rtl"on the <html> element.

<!doctype html>
-<html dir="rtl" lang="ar">
-  ...
-</html>

The RTL feature is still experimental and will probably evolve.


Code licensed MIT

\ No newline at end of file diff --git a/docs/scroller.html b/docs/scroller.html deleted file mode 100644 index c792390d..00000000 --- a/docs/scroller.html +++ /dev/null @@ -1,5 +0,0 @@ -Horizontal scroller • Pico.css

Horizontal scroller

<figure> acts as a container to make any content scrollable horizontally.

Useful to have responsive <table>

#HeadingHeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading
1CellCellCellCellCellCellCellCellCell
2CellCellCellCellCellCellCellCellCell
3CellCellCellCellCellCellCellCellCell
<figure>
-  <table>
-    …
-  </table>
-</figure>

Code licensed MIT

\ No newline at end of file diff --git a/docs/scss/components/_modal.scss b/docs/scss/components/_modal.scss deleted file mode 100644 index f39ce7c5..00000000 --- a/docs/scss/components/_modal.scss +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Docs: Modal - */ - -dialog.example { - display: block; - z-index: inherit; - position: relative; - top: inherit; - right: inherit; - bottom: inherit; - left: inherit; - align-items: inherit; - justify-content: inherit; - width: inherit; - min-width: inherit; - height: inherit; - min-height: inherit; - padding: 0; - background-color:inherit; - - article { - max-width: inherit; - } - - &:not([open]), - &[open=false] { - display: none; - } -} - -.dialog-is-open body > button { - filter: blur(0.125rem); -} \ No newline at end of file diff --git a/docs/scss/components/_theme-switcher.scss b/docs/scss/components/_theme-switcher.scss index bcc59d29..42d02690 100644 --- a/docs/scss/components/_theme-switcher.scss +++ b/docs/scss/components/_theme-switcher.scss @@ -26,8 +26,8 @@ currentColor 50%, transparent 50% ); - content: ""; vertical-align: bottom; + content: ""; transition: transform var(--transition); } @@ -36,8 +36,8 @@ max-width: 0; padding: 0; overflow: hidden; - font-style: normal; font-size: 0.875rem; + font-style: normal; white-space: nowrap; } diff --git a/docs/scss/content/_code.scss b/docs/scss/content/_code.scss index 1b837358..1c80be3b 100644 --- a/docs/scss/content/_code.scss +++ b/docs/scss/content/_code.scss @@ -8,17 +8,17 @@ article > footer.code { } article pre, article pre code { - margin-bottom: 0; background: transparent; + margin-bottom: 0; } // Code block outside article // Horizontally aligned with
content section > pre { + background: var(--article-code-background-color); margin: var(--block-spacing-vertical) 0; padding: calc(var(--block-spacing-vertical) / 1.5) var(--block-spacing-horizontal); - background: var(--article-code-background-color); box-shadow: var(--card-box-shadow); } diff --git a/docs/scss/content/_typography.scss b/docs/scss/content/_typography.scss index 917c21a7..09a9919e 100644 --- a/docs/scss/content/_typography.scss +++ b/docs/scss/content/_typography.scss @@ -2,10 +2,6 @@ * Docs: Typography */ -h1 { - margin-top: -0.25em; -} - section > hgroup { margin-bottom: calc(var(--typography-spacing-vertical) * 2); } diff --git a/docs/scss/layout/_aside.scss b/docs/scss/layout/_aside.scss index f413e856..aaa5d6a5 100644 --- a/docs/scss/layout/_aside.scss +++ b/docs/scss/layout/_aside.scss @@ -3,11 +3,14 @@ */ main > aside { - nav { width: 100%; - margin-bottom: calc(var(--block-spacing-vertical) * 2); - + margin-bottom: var(--block-spacing-vertical); + + h1 { + margin-bottom: calc(var(--typography-spacing-vertical) / 2); + } + @media (min-width: map-get($breakpoints, "lg")) { position: fixed; width: 200px; @@ -15,58 +18,12 @@ main > aside { margin-bottom: 0; overflow-x: hidden; overflow-y: auto; - } - a#toggle-docs-navigation { - margin: 0; - margin-bottom: var(--spacing); - padding: 0; - padding-bottom: var(--spacing); - border-bottom: var(--border-width) solid var(--accordion-border-color); - - svg { - margin-right: calc(var(--spacing) * 0.5); - vertical-align: -3px; - } - - @media (min-width: map-get($breakpoints, "lg")) { + h1 { display: none; } } - - &.closed-on-mobile { - margin-bottom: var(--block-spacing-vertical); - - a#toggle-docs-navigation { - svg.collapse { - display: none; - } - } - - details { - display: none; - } - - @media (min-width: map-get($breakpoints, "lg")) { - details { - display: block; - } - - > a#toggle-docs-navigation { - display: none; - } - } - } - - &.open { - a#toggle-docs-navigation { - svg.expand { - display: none; - } - } - } } - li, summary { @@ -76,7 +33,7 @@ main > aside { } li a { - padding: 0.375rem 0.5rem; + padding: 0.25rem 0.5rem; svg { vertical-align: middle; @@ -94,12 +51,13 @@ main > aside { } details { + padding-bottom: 0.25rem; border-bottom: none; summary { color: var(--h1-color); - font-weight: 300; font-size: 14px; + font-weight: 300; text-transform: uppercase; &::after { @@ -108,12 +66,8 @@ main > aside { } &[open] { - > summary { - margin-bottom: calc(var(--spacing) * 0.75); - - &:not(:focus) { - color: var(--h1-color); - } + > summary:not(:focus) { + color: var(--h1-color); } } } diff --git a/docs/scss/layout/_documentation.scss b/docs/scss/layout/_documentation.scss index 34974616..12c1be22 100644 --- a/docs/scss/layout/_documentation.scss +++ b/docs/scss/layout/_documentation.scss @@ -4,14 +4,8 @@ // Docs: Themes #themes { - button.theme-switcher { - &:first-of-type { - --font-weight: bold; - } - - i { - font-style: normal; - } + button i { + font-style: normal; } } @@ -19,14 +13,14 @@ #customization { figure { display: grid; - grid-template-rows: repeat(2, 1fr); grid-template-columns: repeat(9, 1fr); + grid-template-rows: repeat(2, 1fr); margin-bottom: 0; overflow: hidden; @media (min-width: map-get($breakpoints, "sm")) { - grid-template-rows: 1fr; grid-template-columns: repeat(18, 1fr); + grid-template-rows: 1fr; border-top-right-radius: var(--border-radius); border-top-left-radius: var(--border-radius); } @@ -51,8 +45,8 @@ &.picked { background-image: var(--icon-check); background-position: center; - background-size: 0.66rem auto; background-repeat: no-repeat; + background-size: 0.66rem auto; box-shadow: inset 0 0 1rem 0 rgba(0, 0, 0, 0.25); } &[data-color="lime"], @@ -74,8 +68,8 @@ } } -// Docs: Grid -#grid { +// Docs: Grids +#grids { --grid-spacing-vertical: 1rem; button { @@ -121,10 +115,3 @@ #forms div.grid { grid-row-gap: 0; } - -// Docs: Modal -#modal { - button { - --font-weight: bold; - } -} diff --git a/docs/scss/layout/_main.scss b/docs/scss/layout/_main.scss index 199e3efe..b172f08a 100644 --- a/docs/scss/layout/_main.scss +++ b/docs/scss/layout/_main.scss @@ -12,7 +12,7 @@ body > main { @if map-get($breakpoints, "lg") { @media (min-width: map-get($breakpoints, "lg")) { --block-spacing-horizontal: calc(var(--spacing) * 1.75); - grid-column-gap: calc(var(--block-spacing-horizontal) * 3); + grid-column-gap: calc(var(--block-spacing-horizontal) * 4); display: grid; grid-template-columns: 200px auto; } @@ -30,6 +30,42 @@ body > main { } } +// Anchors hacks for internal links +div[role="document"] > section::before { + display: block; + height: calc(2rem + #{$navHeight} - 0.5rem); + margin-top: calc(-2rem - #{$navHeight} + 0.5rem); + content: ""; + + @if map-get($breakpoints, "sm") { + @media (min-width: map-get($breakpoints, "sm")) { + height: calc(2.5rem + #{$navHeight} - 0.5rem); + height: calc(-2.5rem - #{$navHeight} + 0.5rem); + } + } + + @if map-get($breakpoints, "md") { + @media (min-width: map-get($breakpoints, "md")) { + height: calc(3rem + #{$navHeight} - 0.5rem); + margin-top: calc(-3rem - #{$navHeight} + 0.5rem); + } + } + + @if map-get($breakpoints, "lg") { + @media (min-width: map-get($breakpoints, "lg")) { + height: calc(3.5rem + #{$navHeight} - 0.5rem); + margin-top: calc(-3.5rem - #{$navHeight} + 0.5rem); + } + } + + @if map-get($breakpoints, "xl") { + @media (min-width: map-get($breakpoints, "xl")) { + height: calc(4rem + #{$navHeight} - 0.5rem); + margin-top: calc(-4rem - #{$navHeight} + 0.5rem); + } + } +} + // External links div[role="document"] section a[href*="//"]:not([href*="https://picocss.com"]):not([role])::after { @@ -38,8 +74,8 @@ div[role="document"] section a[href*="//"]:not([href*="https://picocss.com"]):no height: 1rem; background-image: var(--icon-external); background-position: top center; - background-size: 0.66rem auto; background-repeat: no-repeat; + background-size: 0.66rem auto; content: ""; } diff --git a/docs/scss/pico.docs.scss b/docs/scss/pico.docs.scss index d4c17f01..cb4c3729 100644 --- a/docs/scss/pico.docs.scss +++ b/docs/scss/pico.docs.scss @@ -19,6 +19,5 @@ @import "content/code"; // Components -@import "components/modal"; @import "components/nav"; @import "components/theme-switcher"; diff --git a/docs/src/_footer.html b/docs/src/_footer.html deleted file mode 100644 index 12d3be15..00000000 --- a/docs/src/_footer.html +++ /dev/null @@ -1,4 +0,0 @@ -
-
-

Code licensed MIT

-
\ No newline at end of file diff --git a/docs/src/_head.html b/docs/src/_head.html deleted file mode 100644 index da3ec0f0..00000000 --- a/docs/src/_head.html +++ /dev/null @@ -1,8 +0,0 @@ - - -${props.title} • Pico.css - - - - - \ No newline at end of file diff --git a/docs/src/_nav.html b/docs/src/_nav.html deleted file mode 100644 index ec49cb0d..00000000 --- a/docs/src/_nav.html +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/docs/src/_sidebar.html b/docs/src/_sidebar.html deleted file mode 100644 index f3d0dc34..00000000 --- a/docs/src/_sidebar.html +++ /dev/null @@ -1,73 +0,0 @@ - \ No newline at end of file diff --git a/docs/src/accordions.html b/docs/src/accordions.html deleted file mode 100644 index a02bb3f8..00000000 --- a/docs/src/accordions.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - ${require('./_head.html') - title="Accordions" - description="Toggle sections of content in pure HTML, without JavaScript." - canonical="accordions.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="accordions-link"} - -
-
-
-

Accordions

-

Toggle sections of content in pure HTML, without JavaScript.

-
-
-
- Collapsible elements 1 -

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.

-
-
- Collapsible elements 2 -
    -
  • Vestibulum id elit quis massa interdum sodales.
  • -
  • Nunc quis eros vel odio pretium tincidunt nec quis neque.
  • -
  • Quisque sed eros non eros ornare elementum.
  • -
  • Cras sed libero aliquet, porta dolor quis, dapibus ipsum.
  • -
-
-
- -
<details>
-  <summary>Collapsible elements 1</summary>
-  <p>…</p>
-</details>
-
-<details open>
-  <summary>Collapsible elements 2</summary>
-  <ul>
-    <li>…</li>
-    <li>…</li>
-  </ul>
-</details>
- -
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/buttons.html b/docs/src/buttons.html deleted file mode 100644 index ecd74e77..00000000 --- a/docs/src/buttons.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - ${require('./_head.html') - title="Buttons" - description="The essential button in pure HTML, without .classes for the default style." - canonical="buttons.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="buttons-link"} - -
-
-
-

Buttons

-

The essential button in pure HTML, without .classes for the default style.

-
-
- - -
- -
<button>Button</button>
-<input type="submit">
- -
-
-

Buttons are width: 100%; by default. Use <a role="button"> if you need an inline element.

-
- Link - Link -
- -
<a href="#" role="button">Link</a>
-<a href="#" role="button">Link</a>
- -
-
-

Buttons come with .secondary and .contrast styles.

-
- Secondary - Contrast -
- -
<a href="#" role="button" class="secondary">Secondary</a>
-<a href="#" role="button" class="contrast">Contrast</a>
- -
-
-

And a classic .outline variant.

-
- Primary - Secondary - Contrast -
- -
<a href="#" role="button" class="outline">Primary</a>
-<a href="#" role="button" class="secondary outline">Secondary</a>
-<a href="#" role="button" class="contrast outline">Contrast</a>
- -
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/cards.html b/docs/src/cards.html deleted file mode 100644 index 49dbe40f..00000000 --- a/docs/src/cards.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - ${require('./_head.html') - title="Cards" - description="A flexible container with graceful spacings across devices and viewports." - canonical="cards.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="cards-link"} - -
-
-
-

Cards

-

A flexible container with graceful spacings across devices and viewports.

-
-
- I'm a card! -
-
<article>I'm a card!</article>
-

You can use <header> and footer <footer> inside <article>

-
-
Header
- Body -
Footer
-
- -
<article>
-  <header>Header</header>
-  Body
-  <footer>Footer</footer>
-</article>
- -
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/classless.html b/docs/src/classless.html deleted file mode 100644 index f9e494e1..00000000 --- a/docs/src/classless.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - ${require('./_head.html') - title="Class-less version" - description="For wild HTML purists, Pico provides a .classless version." - canonical="classless.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="classless-link"} - -
-
-
-

Class-less version

-

For wild HTML purists!

-
-

Pico provides a .classless version (example).

-

In this version, <header>, <main>, and <footer> act as containers to define a centered or a fluid viewport.

-

Usage:

-

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

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

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

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

These .classless versions are also available on unpkg CDN:

- -
// Centered viewport
-<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.classless.min.css">
-
- -
// Fluid viewport
-<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.fluid.classless.min.css">
-
- -
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/customization.html b/docs/src/customization.html deleted file mode 100644 index 33b8b7ed..00000000 --- a/docs/src/customization.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - ${require('./_head.html') - title="Customization" - description="You can customize themes with SCSS or, you can edit the CSS variables. All Pico's styles and colors are set with CSS custom properties (variables)." - canonical="customization.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="customization-link"} - -
-
-
-

Customization

-

You can customize themes with SCSS or, you can edit the CSS variables.

-
-

Example: pick a color!

- -
-

Custom theme

-
-
- - - -
-
- -
-
-
- -
// Simplified example
-:root {
-  --primary: ;
-}
-
- -
-
-

There are 2 ways to customize your version of Pico.css:

-

Overriding CSS variables

-

All Pico's styles and colors are set with CSS custom properties (variables). Just override the CSS variables to customize your version of Pico.

- -
/* Light scheme (Default) */
-/* Can be forced with data-theme="light" */
-[data-theme="light"],
-:root:not([data-theme="dark"]) {
-  --primary: ;
-  --primary-hover: ;
-  --primary-focus: ;
-  --primary-inverse: ;
-}
-
-/* Dark scheme (Auto) */
-/* Automatically enabled if user has Dark mode enabled */
-@media only screen and (prefers-color-scheme: dark) {
-  :root:not([data-theme="light"]) {
-    --primary: ;
-    --primary-hover: ;
-    --primary-focus: ;
-    --primary-inverse: ;
-  }
-}
-
-/* Dark scheme (Forced) */
-/* Enabled if forced with data-theme="dark" */
-[data-theme="dark"] {
-  --primary: ;
-  --primary-hover: ;
-  --primary-focus: ;
-  --primary-inverse: ;
-}
-
-/* (Common styles) */
-:root {
-  --form-element-active-border-color: var(--primary);
-  --form-element-focus-color: var(--primary-focus);
-  --switch-color: var(--primary-inverse);
-  --switch-checked-background-color: var(--primary);
-}
-
- -

You can find all the CSS variables used in the default theme here: css/themes/default.css

-

Importing Pico SASS library

-

We recommend customizing Pico by importing SASS source files into your project. This way, you can keep Pico up to date without conflicts since Pico code and your custom code are separated.

-

Compile the SASS file to CSS to get a custom version of Pico.

- -
/* Custom  version */
-
-// Override default variables
-$primary-500: ;
-$primary-600: ;
-$primary-700: ;
-
-// Import full Pico source code
-@import "path/pico";
- -

Alternatively, you can create a custom theme and import it into your project with the components you need.

- -
/* Custom  version */
-
-// Custom theme
-@import "path/themes/custom";
-
-// Import needed components
-@import "path/layout/document";
-@import "path/layout/sectioning";
-
-
- -

Compiling a custom SASS version allows you to create a lighter version with only the components that are useful to you. Example here: scss/pico.slim.scss.

-
- - ${require('./_footer.html')} - -
-
- - - - diff --git a/docs/src/forms.html b/docs/src/forms.html deleted file mode 100644 index 15e93c11..00000000 --- a/docs/src/forms.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - ${require('./_head.html') - title="Forms" - description="All form elements are fully responsive in pure semantic HTML, allowing forms to scale gracefully across devices and viewports." - canonical="forms.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="forms-link"} - -
-
-
-

Forms

-

All form elements are fully responsive in pure semantic HTML, allowing forms to scale gracefully across devices and viewports.

-
-

Inputs are width: 100%; by default. You can use .grid inside a form.

-

All natives form elements are fully customizable and themeable with CSS variables.

-
-
-
- - -
- - - We'll never share your email with anyone else. - -
-
- -
<form>
-
-  <!-- Grid -->
-  <div class="grid">
-
-    <!-- Markup example 1: input is inside label -->
-    <label for="firstname">
-      First name
-      <input type="text" id="firstname" name="firstname" placeholder="First name" required>
-    </label>
-
-    <label for="lastname">
-      Last name
-      <input type="text" id="lastname" name="lastname" placeholder="Last name" required>
-    </label>
-
-  </div>
-
-  <!-- Markup example 2: input is after label -->
-  <label for="email">Email address</label>
-  <input type="email" id="email" name="email" placeholder="Email address" required>
-  <small>We'll never share your email with anyone else.</small>
-
-  <!-- Button -->
-  <button type="submit">Submit</button>
-
-</form>
- -
-
-

Disabled and validation states:

-
-
- - - - -
-
- -
<input type="text" placeholder="Valid" aria-invalid="false">
-<input type="text" placeholder="Invalid" aria-invalid="true">
-<input type="text" placeholder="Disabled" disabled>
-<input type="text" value="Readonly" readonly>
- -
-
-

<fieldset> is unstyled and acts as a container for radios and checkboxes, providing a consistent margin-bottom for the set.

-

role="switch" on a type="checkbox" enable a custom switch.

-
- - -
- Size - - - -
-
- -
-
- -
-
- -
<!-- Select -->
-<label for="fruit">Fruit</label>
-<select id="fruit" required>
-  <option value="" selected>Select a fruit…</option>
-  <option>…</option>
-</select>
-
-<!-- Radios -->
-<fieldset>
-  <legend>Size</legend>
-  <label for="small">
-    <input type="radio" id="small" name="size" value="small" checked>
-    Small
-  </label>
-  <label for="medium">
-    <input type="radio" id="medium" name="size" value="medium">
-    Medium
-  </label>
-  <label for="large">
-    <input type="radio" id="large" name="size" value="large">
-    Large
-  </label>
-</fieldset>
-
-<!-- Checkbox -->
-<fieldset>
-  <label for="terms">
-    <input type="checkbox" id="terms" name="terms">
-    I agree to the Terms and Conditions
-  </label>
-</fieldset>
-
-<!-- Switch -->
-<fieldset>
-  <label for="switch">
-    <input type="checkbox" id="switch" name="switch" role="switch">
-    Publish on my profile
-  </label>
-</fieldset>
- -
-
-

You can change a checkbox to an indeterminate state by setting the indeterminate property to true

-
- - -
- -
<script>
-  document.getElementById('indeterminate-checkbox').indeterminate = true;
-</script>
- -
-
-

Others input types:

-
- - - - - -
- -
<!-- File browser -->
-<label for="file">File browser
-  <input type="file" id="file" name="file">
-</label>
-
-<!-- Range slider -->
-<label for="range">Range slider
-  <input type="range" min="0" max="100" value="50" id="range" name="range">
-</label>
-
-<!-- Date -->
-<label for="date">Date
-  <input type="date" id="date" name="date">
-</label>
-
-<!-- Time -->
-<label for="time">Time
-  <input type="time" id="time" name="time">
-</label>
-
-<!-- Color -->
-<label for="color">Color
-  <input type="color" id="color" name="color" value="#0eaaaa">
-</label>
- -
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/grid.html b/docs/src/grid.html deleted file mode 100644 index 78c3fcce..00000000 --- a/docs/src/grid.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - ${require('./_head.html') - title="Grid" - description=".grid enable a minimal grid system with auto-layout columns." - canonical="grid.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="grid-link"} - -
-
-
-

Grid

-

.grid enable a minimal grid system with auto-layout columns.

-
-
-
-
1
-
2
-
3
-
4
-
-
- -
<div class="grid">
-  <div>1</div>
-  <div>2</div>
-  <div>3</div>
-  <div>4</div>
-</div>
- -
-
-

Columns intentionally collapses below large devices (992px)

-

To go further, discover how to merge Pico with the Bootstrap grid system.

-
- - -  More about grids - -

As Pico focuses on native HTML elements, we kept this grid system very minimalist.

-

A complete grid system in flexbox, with all the ordering, offsetting and, breakpoints utilities, can be heavier than the total size of the Pico library. Not really in the Pico spirit.

-

If you need a quick way to prototyping or build a complex layout, you can look at Flexbox grid layouts. For example, Bootstrap Grid System only or Flexbox Grid.

-

If you need a light and custom grid, you can look at CSS Grid Generators. For example, CSS Grid Generator, Layoutit! or Griddy.

-

Alternatively, you can learn about CSS Grid.

-
-
- - ${require('./_footer.html')} - -
-
- - - - diff --git a/docs/src/index.html b/docs/src/index.html deleted file mode 100644 index 9f338886..00000000 --- a/docs/src/index.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - ${require('./_head.html') - title="Documentation" - description="Pico works without package manager or dependencies! There are 3 ways to get started with pico.css: manually, from a CDN, with NPM." - canonical="" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="start-link"} - -
-
-
-

Usage

-

Works without package manager or dependencies 🙂!

-
-

There are 3 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">
-

Install from CDN

-

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

-
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css">
-

Install with NPM

-
npm install @picocss/pico
-

Starter HTML template:

- -
<!doctype html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link rel="stylesheet" href="css/pico.min.css">
-    <title>Hello, world!</title>
-  </head>
-  <body>
-    <main class="container">
-      <h1>Hello, world!</h1>
-    </main>
-  </body>
-</html>
- -
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/loading.html b/docs/src/loading.html deleted file mode 100644 index 4b4cfd12..00000000 --- a/docs/src/loading.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - ${require('./_head.html') - title="Loading" - description="aria-busy='true' enable a loading indicator." - canonical="loading.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="loading-link"} - -
-
-
-

Loading

-

aria-busy="true" enable a loading indicator.

-
-
- - -
- -
<button aria-busy="true">Please wait…</button>
-<button aria-busy="true" class="secondary"></button>
- -
-
-

It can be applied to any block:

-
-
<article aria-busy="true"></article>
-

Or any text element:

- -
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/navs.html b/docs/src/navs.html deleted file mode 100644 index 03d2f54d..00000000 --- a/docs/src/navs.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - ${require('./_head.html') - title="Navs" - description="The essential navbar component in pure semantic HTML." - canonical="navs.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="navs-link"} - -
- - - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/progress.html b/docs/src/progress.html deleted file mode 100644 index 101de8bf..00000000 --- a/docs/src/progress.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - ${require('./_head.html') - title="Progress" - description="Progress bar element in pure HTML, without JavaScript." - canonical="progress.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="progress-link"} - -
-
-
-

Progress

-

Progress bar element in pure HTML, without JavaScript.

-
-
- -
- -
<progress value="25" max="100"></progress>
- -
-
-

You can change a progress bar to an indeterminate state by setting the indeterminate property to true

-
- - -
- -
<script>
-  document.getElementById('indeterminate-progress').indeterminate = true;
-</script>
- -
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/rtl.html b/docs/src/rtl.html deleted file mode 100644 index 268d297a..00000000 --- a/docs/src/rtl.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - ${require('./_head.html') - title="RTL (Right-To-Left)" - description="Support for right-to-left text in Pico with dir='rtl'" - canonical="rtl.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="rtl-link"} - -
-
-
-

RTL

-

Support for right-to-left text in Pico.

-
-

To enable RTL in Pico you need to set dir="rtl"on the <html> element.

- -
<!doctype html>
-<html dir="rtl" lang="ar">
-  ...
-</html>
- -

The RTL feature is still experimental and will probably evolve.

-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/scroller.html b/docs/src/scroller.html deleted file mode 100644 index 57f2da63..00000000 --- a/docs/src/scroller.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - ${require('./_head.html') - title="Horizontal scroller" - description="<figure> acts as a container to make any content scrollable horizontally." - canonical="scroller.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="scroller-link"} - -
-
-
-

Horizontal scroller

-

<figure> acts as a container to make any content scrollable horizontally.

-
-

Useful to have responsive <table>

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#HeadingHeadingHeadingHeadingHeadingHeadingHeadingHeadingHeading
1CellCellCellCellCellCellCellCellCell
2CellCellCellCellCellCellCellCellCell
3CellCellCellCellCellCellCellCellCell
-
- -
<figure>
-  <table>
-    …
-  </table>
-</figure>
- -
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/tables.html b/docs/src/tables.html deleted file mode 100644 index a8e895da..00000000 --- a/docs/src/tables.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - ${require('./_head.html') - title="Tables" - description="Default styles for tables without .classes" - canonical="tables.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="tables-link"} - -
-
-
-

Tables

-

Default styles for tables without .classes

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#HeadingHeadingHeadingHeadingHeading
1CellCellCellCellCell
2CellCellCellCellCell
3CellCellCellCellCell
-
- -
<table>
-  <thead>
-    <tr>
-      <th scope="col">#</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <th scope="row">1</th>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-    </tr>
-    <tr>
-      <th scope="row">1</th>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-    </tr>
-    <tr>
-      <th scope="row">1</th>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-    </tr>
-  </tbody>
-</table>
- -

role="grid" enable striped rows.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#HeadingHeadingHeadingHeadingHeading
1CellCellCellCellCell
2CellCellCellCellCell
3CellCellCellCellCell
-
- -
<table role="grid">
-  
-</table>
- -
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/themes.html b/docs/src/themes.html deleted file mode 100644 index 7fccd347..00000000 --- a/docs/src/themes.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - ${require('./_head.html') - title="Themes" - description="Pico is shipped with 2 consistent themes: Light & Dark. The Light theme is used by default. The Dark theme is automatically enabled if the user has dark mode enabled ('prefers-color-scheme: dark')." - canonical="themes.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="themes-link"} - -
-
-
-

Themes

-

Pico is shipped with 2 consistent themes: Light & Dark.

-
-

The Light theme is used by default. The Dark theme is automatically enabled if the user has dark mode enabled prefers-color-scheme: dark

-
- -
-

Themes can be forced on document level <html data-theme="light"> or on any HTML element <article data-theme="dark">

-
-

Light theme

-
- - - -
-
- -
<article data-theme="light">
-  …
-</article>
- -
-
-
-

Dark theme

-
- - - -
-
- -
<article data-theme="dark">
-  …
-</article>
- -
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/tooltips.html b/docs/src/tooltips.html deleted file mode 100644 index f239ba5b..00000000 --- a/docs/src/tooltips.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - ${require('./_head.html') - title="Tooltips" - description="Enable tooltips everywhere in pure HTML, without JavaScript." - canonical="tooltips.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="tooltips-link"} - -
-
-
-

Tooltips

-

Enable tooltips everywhere in pure HTML, without JavaScript.

-
-
-

Tooltip on a link

-

Tooltip on inline element

-

-
- -
<p>Tooltip on a <a href="#" data-tooltip="Tooltip">link</a></p>
-<p>Tooltip on <em data-tooltip="Tooltip">inline element</em></p>
-<p><button data-tooltip="Tooltip">Tooltip on a button</button></p>
- -
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/src/we-love-classes.html b/docs/src/we-love-classes.html deleted file mode 100644 index 304f0d0f..00000000 --- a/docs/src/we-love-classes.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - ${require('./_head.html') - title="We love .classes" - description="As a starting point, Pico chose to be as neutral and semantic as possible using very few .classes. But of course, .classes are not a bad practice at all. Feel free to use modifiers." - canonical="we-love-classes.html" - } - - - - ${require('./_nav.html')} - -
- ${require('./_sidebar.html') active="we-love-classes-link"} - -
-
-

We love .classes

-

As a starting point, Pico chose to be as neutral and semantic as possible using very few .classes

-

But of course, .classes are not a bad practice at all.

-

Feel free to use modifiers.

-
-
<button class="warning">Action</button>
-
-

Just try to keep your HTML clean and semantic to keep the Pico spirit.

-
-
<button class="button-red margin-large padding-medium">Action</button>
-
-
- - ${require('./_footer.html')} - -
-
- - - diff --git a/docs/tables.html b/docs/tables.html deleted file mode 100644 index 1a2e74e3..00000000 --- a/docs/tables.html +++ /dev/null @@ -1,40 +0,0 @@ -Tables • Pico.css

Tables

Default styles for tables without .classes

#HeadingHeadingHeadingHeadingHeading
1CellCellCellCellCell
2CellCellCellCellCell
3CellCellCellCellCell
<table>
-  <thead>
-    <tr>
-      <th scope="col">#</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-      <th scope="col">Heading</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <th scope="row">1</th>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-    </tr>
-    <tr>
-      <th scope="row">1</th>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-    </tr>
-    <tr>
-      <th scope="row">1</th>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-      <td>Cell</td>
-    </tr>
-  </tbody>
-</table>

role="grid" enable striped rows.

#HeadingHeadingHeadingHeadingHeading
1CellCellCellCellCell
2CellCellCellCellCell
3CellCellCellCellCell
<table role="grid">
-  
-</table>

Code licensed MIT

\ No newline at end of file diff --git a/docs/themes.html b/docs/themes.html deleted file mode 100644 index 8582c365..00000000 --- a/docs/themes.html +++ /dev/null @@ -1,5 +0,0 @@ -Themes • Pico.css

Themes

Pico is shipped with 2 consistent themes: Light & Dark.

The Light theme is used by default. The Dark theme is automatically enabled if the user has dark mode enabled prefers-color-scheme: dark

Themes can be forced on document level <html data-theme="light"> or on any HTML element <article data-theme="dark">

Light theme

<article data-theme="light">
-  …
-</article>

Dark theme

<article data-theme="dark">
-  …
-</article>

Code licensed MIT

\ No newline at end of file diff --git a/docs/tooltips.html b/docs/tooltips.html deleted file mode 100644 index 226d8997..00000000 --- a/docs/tooltips.html +++ /dev/null @@ -1,3 +0,0 @@ -Tooltips • Pico.css

Tooltips

Enable tooltips everywhere in pure HTML, without JavaScript.

Tooltip on a link

Tooltip on inline element

<p>Tooltip on a <a href="#" data-tooltip="Tooltip">link</a></p>
-<p>Tooltip on <em data-tooltip="Tooltip">inline element</em></p>
-<p><button data-tooltip="Tooltip">Tooltip on a button</button></p>

Code licensed MIT

\ No newline at end of file diff --git a/docs/we-love-classes.html b/docs/we-love-classes.html deleted file mode 100644 index 20ed0fac..00000000 --- a/docs/we-love-classes.html +++ /dev/null @@ -1 +0,0 @@ -We love .classes • Pico.css

We love .classes

As a starting point, Pico chose to be as neutral and semantic as possible using very few .classes

But of course, .classes are not a bad practice at all.

Feel free to use modifiers.

<button class="warning">Action</button>

Just try to keep your HTML clean and semantic to keep the Pico spirit.

<button class="button-red margin-large padding-medium">Action</button>

Code licensed MIT

\ No newline at end of file diff --git a/scss/components/_accordion.scss b/scss/components/_accordion.scss index 132a7898..97038213 100644 --- a/scss/components/_accordion.scss +++ b/scss/components/_accordion.scss @@ -1,5 +1,6 @@ /** * Accordion (
) + * Inspiration: https://codepen.io/koca/pen/RyeLLV */ details { @@ -41,8 +42,8 @@ details { transform: rotate(-90deg); background-image: var(--icon-chevron); background-position: center; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; content: ""; @if $enable-transitions { diff --git a/scss/components/_progress.scss b/scss/components/_progress.scss index 01d17911..e232490f 100644 --- a/scss/components/_progress.scss +++ b/scss/components/_progress.scss @@ -21,10 +21,10 @@ progress { // Reset the default appearance -webkit-appearance: none; -moz-appearance: none; + appearance: none; // Styles display: inline-block; - appearance: none; width: 100%; height: 0.5rem; margin-bottom: calc(var(--spacing) * 0.5); diff --git a/scss/content/_button.scss b/scss/content/_button.scss index 06abe17b..a2ffdede 100644 --- a/scss/content/_button.scss +++ b/scss/content/_button.scss @@ -65,8 +65,8 @@ a[role="button"] { background-color: var(--background-color); box-shadow: var(--box-shadow); color: var(--color); - font-weight: var(--font-weight); font-size: 1rem; + font-weight: var(--font-weight); line-height: var(--line-height); text-align: center; cursor: pointer; diff --git a/scss/content/_code.scss b/scss/content/_code.scss index 516ec233..dcef0adf 100644 --- a/scss/content/_code.scss +++ b/scss/content/_code.scss @@ -13,8 +13,8 @@ pre, code, kbd, samp { - font-size: 0.875em; // 2 font-family: var(--font-family); // 1 + font-size: 0.875em; // 2 } // Prevent overflow of the container in all browsers (opinionated) @@ -29,11 +29,11 @@ pre { pre, code, kbd { - border-radius: var(--border-radius); background: var(--code-background-color); color: var(--code-color); font-weight: var(--font-weight); line-height: initial; + border-radius: var(--border-radius); } code, @@ -48,9 +48,9 @@ pre { overflow-x: auto; > code { + background: transparent; display: block; padding: var(--spacing); - background: transparent; font-size: 14px; line-height: var(--line-height); } diff --git a/scss/content/_form-alt-input-types.scss b/scss/content/_form-alt-input-types.scss index 9217b970..058a5690 100644 --- a/scss/content/_form-alt-input-types.scss +++ b/scss/content/_form-alt-input-types.scss @@ -34,7 +34,7 @@ } // Date & Time -:not([dir="rtl"]) { +:not(:dir(rtl)) { [type="date"], [type="datetime-local"], [type="month"], @@ -42,8 +42,8 @@ [type="week"] { background-image: var(--icon-date); background-position: center right 0.75rem; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; &::-webkit-calendar-picker-indicator { opacity: 0; @@ -77,8 +77,8 @@ --color: var(--secondary-inverse); margin-right: calc(var(--spacing) / 2); margin-left: 0; - margin-inline-start: 0; margin-inline-end: calc(var(--spacing) / 2); + margin-inline-start: 0; padding: calc(var(--form-element-spacing-vertical) * 0.5) calc(var(--form-element-spacing-horizontal) * 0.5); border: var(--border-width) solid var(--border-color); @@ -87,8 +87,8 @@ background-color: var(--background-color); box-shadow: var(--box-shadow); color: var(--color); - font-weight: var(--font-weight); font-size: 1rem; + font-weight: var(--font-weight); line-height: var(--line-height); text-align: center; cursor: pointer; @@ -222,8 +222,8 @@ ) !important; background-image: var(--icon-search); background-position: center left 1.125rem; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; } // Cancel button diff --git a/scss/content/_form-checkbox-radio.scss b/scss/content/_form-checkbox-radio.scss index 1d229ed1..e07d2360 100644 --- a/scss/content/_form-checkbox-radio.scss +++ b/scss/content/_form-checkbox-radio.scss @@ -13,8 +13,8 @@ margin-top: -0.125em; margin-right: 0.375em; margin-left: 0; - margin-inline-start: 0; margin-inline-end: 0.375em; + margin-inline-start: 0; border-width: var(--border-width); vertical-align: middle; cursor: pointer; @@ -30,8 +30,8 @@ --border-color: var(--primary); background-image: var(--icon-checkbox); background-position: center; - background-size: 0.75em auto; background-repeat: no-repeat; + background-size: 0.75em auto; } & ~ label { @@ -49,8 +49,8 @@ --border-color: var(--primary); background-image: var(--icon-minus); background-position: center; - background-size: 0.75em auto; background-repeat: no-repeat; + background-size: 0.75em auto; } } @@ -115,8 +115,8 @@ &::before { margin-right: 0; margin-left: calc(#{$switch-width * 0.5} - var(--border-width)); - margin-inline-start: calc(#{$switch-width * 0.5} - var(--border-width)); margin-inline-end: 0; + margin-inline-start: calc(#{$switch-width * 0.5} - var(--border-width)); } } } diff --git a/scss/content/_form.scss b/scss/content/_form.scss index 7ec39774..b834ec34 100644 --- a/scss/content/_form.scss +++ b/scss/content/_form.scss @@ -14,10 +14,10 @@ optgroup, select, textarea { margin: 0; // 2 - font-size: 1rem; // 1 - line-height: var(--line-height); // 1 font-family: inherit; // 1 + font-size: 1rem; // 1 letter-spacing: inherit; // 2 + line-height: var(--line-height); // 1 } // Show the overflow in IE. @@ -223,19 +223,19 @@ textarea { var(--form-element-spacing-horizontal) + 1.5rem ) !important; padding-left: var(--form-element-spacing-horizontal); - padding-inline-start: var(--form-element-spacing-horizontal) !important; padding-inline-end: calc( var(--form-element-spacing-horizontal) + 1.5rem ) !important; + padding-inline-start: var(--form-element-spacing-horizontal) !important; } @else { padding-right: calc(var(--form-element-spacing-horizontal) + 1.5rem); padding-left: var(--form-element-spacing-horizontal); - padding-inline-start: var(--form-element-spacing-horizontal); padding-inline-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); + padding-inline-start: var(--form-element-spacing-horizontal); } background-position: center right 0.75rem; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; } &[aria-invalid="false"] { @@ -282,12 +282,8 @@ textarea { input, select, textarea { - &:not([type="checkbox"]):not([type="radio"]) { - &[aria-invalid], - &[aria-invalid="true"], - &[aria-invalid="false"] { - background-position: center left 0.75rem; - } + &[aria-invalid] { + background-position: center left 0.75rem; } } } @@ -320,12 +316,12 @@ select { &:not([multiple]):not([size]) { padding-right: calc(var(--form-element-spacing-horizontal) + 1.5rem); padding-left: var(--form-element-spacing-horizontal); - padding-inline-start: var(--form-element-spacing-horizontal); padding-inline-end: calc(var(--form-element-spacing-horizontal) + 1.5rem); + padding-inline-start: var(--form-element-spacing-horizontal); background-image: var(--icon-chevron); background-position: center right 0.75rem; - background-size: 1rem auto; background-repeat: no-repeat; + background-size: 1rem auto; } } diff --git a/scss/content/_miscs.scss b/scss/content/_miscs.scss index db4a1742..9cdeb89e 100644 --- a/scss/content/_miscs.scss +++ b/scss/content/_miscs.scss @@ -27,6 +27,29 @@ template { } } +// Add the correct styles in Edge 18-, IE, and Safari +dialog { + display: block; + position: absolute; + right: 0; + left: 0; + width: -moz-fit-content; + width: -webkit-fit-content; + width: fit-content; + height: -moz-fit-content; + height: -webkit-fit-content; + height: fit-content; + margin: auto; + padding: 1em; + border: solid; + background-color: white; + color: black; +} + +dialog:not([open]) { + display: none; +} + // Add the correct display in IE 9- canvas { display: inline-block; diff --git a/scss/content/_table.scss b/scss/content/_table.scss index d9dcd93b..a177171e 100644 --- a/scss/content/_table.scss +++ b/scss/content/_table.scss @@ -27,8 +27,8 @@ td { padding: calc(var(--spacing) / 2) var(--spacing); border-bottom: var(--border-width) solid var(--table-border-color); color: var(--color); - font-weight: var(--font-weight); font-size: var(--font-size); + font-weight: var(--font-weight); text-align: left; text-align: start; } diff --git a/scss/content/_typography.scss b/scss/content/_typography.scss index 020761b0..36421dc8 100644 --- a/scss/content/_typography.scss +++ b/scss/content/_typography.scss @@ -61,9 +61,9 @@ ul { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--color); - font-style: normal; - font-weight: var(--font-weight); font-size: var(--font-size); + font-weight: var(--font-weight); + font-style: normal; } // Links @@ -135,9 +135,9 @@ h6 { margin-top: 0; margin-bottom: var(--typography-spacing-vertical); color: var(--color); - font-weight: var(--font-weight); - font-size: var(--font-size); font-family: var(--font-family); + font-size: var(--font-size); + font-weight: var(--font-weight); } h1 { @@ -191,8 +191,8 @@ hgroup { > *:last-child { --color: var(--muted-color); --font-weight: unset; - font-size: 1rem; font-family: unset; + font-size: 1rem; } } @@ -211,8 +211,8 @@ ul, ol { padding-right: 0; padding-left: var(--spacing); - padding-inline-start: var(--spacing); padding-inline-end: 0; + padding-inline-start: var(--spacing); li { margin-bottom: calc(var(--typography-spacing-vertical) * 0.25); @@ -238,8 +238,8 @@ blockquote { padding: var(--spacing); border-right: none; border-left: 0.25rem solid var(--blockquote-border-color); - border-inline-start: 0.25rem solid var(--blockquote-border-color); border-inline-end: none; + border-inline-start: 0.25rem solid var(--blockquote-border-color); footer { margin-top: calc(var(--typography-spacing-vertical) * 0.5); diff --git a/scss/layout/_document.scss b/scss/layout/_document.scss index 4ad903b9..83941354 100644 --- a/scss/layout/_document.scss +++ b/scss/layout/_document.scss @@ -32,14 +32,14 @@ html { -webkit-text-size-adjust: 100%; // 2 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 3 + tab-size: 4; // 5 -ms-text-size-adjust: 100%; // 6 - text-rendering: optimizeLegibility; background-color: var(--background-color); color: var(--color); - font-weight: var(--font-weight); - font-size: var(--font-size); - line-height: var(--line-height); // 1 font-family: var(--font-family); + font-size: var(--font-size); + font-weight: var(--font-weight); + line-height: var(--line-height); // 1 + text-rendering: optimizeLegibility; cursor: default; // 4 - tab-size: 4; // 5 } diff --git a/scss/pico.scss b/scss/pico.scss index dc792704..cb9c18fa 100644 --- a/scss/pico.scss +++ b/scss/pico.scss @@ -31,7 +31,6 @@ // Components @import "components/accordion"; // details, summary @import "components/card"; // article -@import "components/modal"; // dialog @import "components/nav"; // nav @import "components/progress"; // progress diff --git a/scss/postcss.config.js b/scss/postcss.config.js deleted file mode 100644 index 4eaff478..00000000 --- a/scss/postcss.config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - syntax: "postcss-scss", - map: false, - plugins: { - "css-declaration-sorter": { - order: "smacss" - } - } -} \ No newline at end of file diff --git a/scss/themes/default/_dark.scss b/scss/themes/default/_dark.scss index b0d11a05..5128e1ff 100644 --- a/scss/themes/default/_dark.scss +++ b/scss/themes/default/_dark.scss @@ -112,9 +112,6 @@ 0 0 0 0.0625rem #{rgba($black, 0.036)}; --card-sectionning-background-color: #{mix($black, $grey-900, 12.5%)}; - // Modal () - --modal-overlay-background-color: #{rgba(mix($grey-900, $grey-800), 0.9)}; - // Progress --progress-background-color: #{mix($grey-900, $grey-800)}; --progress-color: var(--primary); @@ -127,13 +124,12 @@ --tooltip-color: var(--contrast-inverse); // Icons - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='#{rgba($grey-300, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='#{rgba($grey-500, .999)}' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='#{rgba($grey-300, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='#{rgba($red-900, .999)}' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); - --icon-search: 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='#{rgba($grey-300, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); --icon-time: 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='#{rgba($grey-300, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-search: 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='#{rgba($grey-300, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='#{rgba($green-800, .999)}' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='#{rgba($red-900, .999)}' 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"); } diff --git a/scss/themes/default/_light.scss b/scss/themes/default/_light.scss index 2073bd7d..54766e39 100644 --- a/scss/themes/default/_light.scss +++ b/scss/themes/default/_light.scss @@ -112,9 +112,6 @@ 0 0 0 0.0625rem #{rgba($grey-900, 0.024)}; --card-sectionning-background-color: #{mix($grey-50, $white, 25%)}; - // Modal () - --modal-overlay-background-color: #{rgba($grey-100, 0.8)}; - // Progress --progress-background-color: #{$grey-100}; --progress-color: var(--primary); @@ -127,13 +124,12 @@ --tooltip-color: var(--contrast-inverse); // Icons - --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); --icon-chevron: 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='#{rgba($grey-700, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); - --icon-close: 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='#{rgba($grey-500, .999)}' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E"); --icon-date: 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='#{rgba($grey-700, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E"); - --icon-invalid: 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='#{rgba($red-800, .999)}' 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"); - --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); + --icon-time: 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='#{rgba($grey-700, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); --icon-search: 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='#{rgba($grey-700, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E"); - --icon-time: 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='#{rgba($grey-700, .999)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-checkbox: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-minus: 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='%23FFF' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E"); --icon-valid: 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='#{rgba($green-700, .999)}' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E"); + --icon-invalid: 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='#{rgba($red-800, .999)}' 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"); } diff --git a/scss/themes/default/_styles.scss b/scss/themes/default/_styles.scss index e10732d4..31f123a5 100644 --- a/scss/themes/default/_styles.scss +++ b/scss/themes/default/_styles.scss @@ -120,27 +120,6 @@ } } } - - // Modal - dialog > article { - - --block-spacing-vertical: calc(var(--spacing) * 2); - --block-spacing-horizontal: var(--spacing); - - @if map-get($breakpoints, "sm") { - @media (min-width: map-get($breakpoints, "sm")) { - --block-spacing-vertical: calc(var(--spacing) * 2.5); - --block-spacing-horizontal: calc(var(--spacing) * 1.25); - } - } - - @if map-get($breakpoints, "md") { - @media (min-width: map-get($breakpoints, "md")) { - --block-spacing-vertical: calc(var(--spacing) * 3); - --block-spacing-horizontal: calc(var(--spacing) * 1.5); - } - } - } } // Link diff --git a/scss/utilities/_loading.scss b/scss/utilities/_loading.scss index eb1a7c23..dd1c26b2 100644 --- a/scss/utilities/_loading.scss +++ b/scss/utilities/_loading.scss @@ -18,10 +18,10 @@ border: 0.1875em solid currentColor; border-radius: 1em; border-right-color: transparent; - content: ''; vertical-align: text-bottom; vertical-align: -.125em; // Visual alignment animation: spinner 0.75s linear infinite; + content: ''; opacity: var(--loading-spinner-opacity); } @@ -29,8 +29,8 @@ &::before { margin-right: calc(var(--spacing) * 0.5); margin-left: 0; - margin-inline-start: 0; margin-inline-end: calc(var(--spacing) * 0.5); + margin-inline-start: 0; } } diff --git a/scss/utilities/_tooltip.scss b/scss/utilities/_tooltip.scss index 8c56c0b4..52feba2e 100644 --- a/scss/utilities/_tooltip.scss +++ b/scss/utilities/_tooltip.scss @@ -23,14 +23,14 @@ transform: translate(-50%, -.25rem); border-radius: var(--border-radius); background: var(--tooltip-background-color); - content: attr(data-tooltip); color: var(--tooltip-color); + font-size: .875rem; font-style: normal; font-weight: var(--font-weight); - font-size: .875rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; + content: attr(data-tooltip); opacity: 0; pointer-events: none; } @@ -44,33 +44,25 @@ border-left: .3rem solid transparent; border-radius: 0; background-color: transparent; - content: ''; color: var(--tooltip-background-color); + content: ''; } - // Display &:focus, &:hover { &::before, &::after { opacity: 1; + + @if $enable-transitions { + animation-name: slide; + animation-duration: .2s; + } } - } - // Animations, excluding touch devices - @if $enable-transitions { - @media (hover: hover) and (pointer: fine) { - &:focus, - &:hover { - &::before, - &::after { - animation-duration: .2s; - animation-name: slide; - } - - &::after { - animation-name: slideCaret; - } + &::after { + @if $enable-transitions { + animation-name: slideCaret; } } }