Initial commit 🚀

This commit is contained in:
Lucas 2019-11-27 15:31:49 +07:00
commit 16c7596319
30 changed files with 5996 additions and 0 deletions

172
scss/content/_button.scss Normal file
View file

@ -0,0 +1,172 @@
/**
* Button
*/
// Reboot
// Based on normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
//
// 1. Change the font styles in all browsers.
// 2. Remove the margin in Firefox and Safari
// 3. Show the overflow in Edge
button {
margin: 0; // 2
overflow: visible; // 3
font-family: inherit; // 1
text-transform: none; // 1
}
// Correct the inability to style clickable types in iOS and Safari.
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
// Remove the inner border and padding in Firefox.
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
// Restore the focus styles unset by the previous rule.
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
// Pico
//
button {
display: block;
width: 100%;
margin-bottom: $spacing-typography;
}
a[role="button"] {
display: inline-block;
text-decoration: none;
}
button,
input[type="submit"],
a[role="button"] {
padding: $spacing-input-button;
border: 1px solid var(--primary);
border-radius: $round;
outline: none;
background-color: var(--primary);
color: var(--primary-inverse);
font-size: 1rem;
font-weight: normal;
line-height: $line-height;
text-align: center;
cursor: pointer;
transition:
background-color $transition,
border-color $transition,
color $transition,
box-shadow $transition;
&:hover,
&:active,
&:focus {
border: 1px solid var(--primary-hover);
background-color: var(--primary-hover);
}
&:focus {
box-shadow: 0 0 0 0.2rem var(--primary-focus);
}
}
// Input [type="reset"]
input[type="reset"] {
cursor: pointer;
}
// Button .secondary
@if $enable-classes {
button.secondary,
input.secondary[type="submit"],
input[type="reset"],
a.secondary[role="button"] {
border: 1px solid var(--secondary);
background-color: var(--secondary);
color: var(--secondary-inverse);
&:hover,
&:active,
&:focus {
border: 1px solid var(--secondary-hover);
background-color: var(--secondary-hover);
}
&:focus {
box-shadow: 0 0 0 0.2rem var(--secondary-focus);
}
}
}
// Button .outline
@if $enable-classes {
button.outline,
input.outline[type="submit"],
a.outline[role="button"] {
border: 1px solid var(--primary);
background-color: transparent;
color: var(--primary);
&:hover,
&:active,
&:focus {
border: 1px solid var(--primary-hover);
color: var(--primary-hover);
}
}
}
// Button .outline.secondary
@if $enable-classes {
button.outline.secondary,
input.outline.secondary[type="submit"],
input.outline[type="reset"],
a.outline.secondary[role="button"] {
border: 1px solid var(--secondary);
background-color: transparent;
color: var(--secondary);
&:hover,
&:active,
&:focus {
border: 1px solid var(--secondary-hover);
color: var(--secondary-hover);
}
&:focus {
box-shadow: 0 0 0 0.2rem var(--secondary-focus);
}
}
}
// Button [disabled]
button,
input[type="submit"],
input[type="reset"],
a[role="button"] {
&[disabled] {
opacity: .5;
pointer-events: none;
}
}

113
scss/content/_code.scss Normal file
View file

@ -0,0 +1,113 @@
/**
* Code
*/
// Reboot
//
// 1. Correct the inheritance and scaling of font size in all browsers.
// 2. Correct the odd `em` font sizing in all browsers.
pre,
code,
kbd,
samp {
font-family: $monospace; // 1
font-size: 1rem; // 2
}
// Pico
//
pre,
code,
kbd {
background: var(--code-inlined);
color: var(--muted-text);
font-size: 85%;
font-weight: 400;
line-height: 1;
@if map-get($breakpoints, "sm") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "sm")) {
font-size: 83%;
}
}
@if map-get($breakpoints, "md") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "md")) {
font-size: 81%;
}
}
@if map-get($breakpoints, "lg") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "lg")) {
font-size: 79%;
}
}
@if map-get($breakpoints, "lg") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "xl")) {
font-size: 77%;
}
}
}
code,
kbd {
display: inline-block;
padding: .375rem .5rem;
border-radius: $round;
}
pre {
display: block;
margin-right: -$spacing-gutter;
margin-left: -$spacing-gutter;
padding: $spacing-block $spacing-gutter;
overflow-x: auto;
border-left: .25rem solid var(--code-border);
background: var(--code-background);
@media (min-width: map-get($breakpoints, "sm")) {
margin-right: 0;
margin-left: 0;
}
> code {
display: block;
padding: 0;
background: transparent;
font-size: 14px;
line-height: $line-height;
}
}
// Code syntax
code {
// Tags
b {
color: var(--code-color-1);
font-weight: normal;
}
// Properties
i {
color: var(--code-color-2);
font-style: normal;
}
// Values
u {
color: var(--text);
text-decoration: none;
}
}
// kbd
kbd {
background-color: var(--secondary);
color: var(--secondary-inverse);
font-weight: bolder;
}

322
scss/content/_form.scss Normal file
View file

@ -0,0 +1,322 @@
/**
* Form elements
*/
// Reboot
// Based on normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
//
// 1. Change the font styles in all browsers.
// 2. Remove the margin in Firefox and Safari.
input,
optgroup,
select,
textarea {
margin: 0; // 2
font-family: inherit; // 1
font-size: 1rem; // 1
line-height: $line-height; // 1
}
// Show the overflow in IE.
input {
overflow: visible;
}
// Remove the inheritance of text transform in Edge, Firefox, and IE.
select {
text-transform: none;
}
// 1. Correct the text wrapping in Edge and IE.
// 2. Correct the color inheritance from `fieldset` elements in IE.
// 3. Remove the padding so developers are not caught out when they zero out
// `fieldset` elements in all browsers.
legend {
display: table; // 1
max-width: 100%; // 1
padding: 0; // 3
color: inherit; // 2
white-space: normal; // 1
}
// Remove the default vertical scrollbar in IE 10+.
textarea {
overflow: auto;
}
// Remove the padding in IE 10.
[type="checkbox"],
[type="radio"] {
padding: 0;
}
// Correct the cursor style of increment and decrement buttons in Chrome.
[type="number"]::-webkit-inner-spin-button {
height: auto;
}
// 1. Correct the odd appearance in Chrome and Safari.
// 2. Correct the outline style in Safari.
[type="search"] {
-webkit-appearance: textfield; // 1
outline-offset: -2px; // 2
}
// Remove the inner padding in Chrome and Safari on macOS.
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
// 1. Correct the inability to style clickable types in iOS and Safari.
// 2. Change font properties to `inherit` in Safari.
::-webkit-file-upload-button {
-webkit-appearance: button; // 1
font: inherit; // 2
}
// Pico
//
// Fieldset
fieldset {
margin: 0;
margin-bottom: $spacing-typography;
padding: 0;
border: 0;
}
// Layout
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
form small {
display: block;
width: 100%;
}
// Spacing beteen label and input
$spacing-label-input: $spacing-typography/12;
// Label & legend
label,
fieldset legend {
display: block;
margin-bottom: $spacing-label-input;
vertical-align: middle;
}
// Inputs (Commons styles)
input,
select,
textarea {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border: 1px solid var(--input-border);
border-radius: $round;
outline: none;
background-color: var(--input-background);
color: var(--text);
font-weight: normal;
vertical-align: middle;
transition:
background-color $transition,
border-color $transition,
color $transition,
border-color $transition,
box-shadow $transition;
&::placeholder {
color: var(--muted-text);
opacity: 1;
}
&:active,
&:focus {
border-color: var(--primary);
}
&:focus {
box-shadow: 0 0 0 0.2rem var(--primary-focus);
}
&[readonly],
&[disabled] {
border-color: var(--muted-border);
box-shadow: none;
& ~ label {
color: var(--muted-text);
}
}
&[disabled] {
background-color: var(--muted-background);
opacity: .5;
}
// Undo the Firefox inner focus ring
&:focus:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #000;
}
}
// Text, Select & Textarea
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
margin-bottom: $spacing-typography;
padding: $spacing-input-button;
// Validation states
&[invalid]:not(:focus),
&[valid]:not(:focus) {
padding-right: 2rem;
background-position: center right .75rem;
background-repeat: no-repeat;
background-size: 1rem auto;
}
&[invalid]:not(:focus) {
// Source: https://feathericons.com/
$invalid-icon-color: "b94646"; // Without '#' !important
border-bottom: 1px solid var(--invalid);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $invalid-icon-color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
}
&[valid]:not(:focus) {
// Source: https://feathericons.com/
$valid-icon-color: "288a6a"; // Without '#' !important
border-bottom: 1px solid var(--valid);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $valid-icon-color + "' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}
}
// Select
select {
// Unstyle the caret on `<select>`s in IE10+.
&::-ms-expand {
border: 0;
background-color: transparent;
}
&:not([multiple]) {
// Source: https://feathericons.com/
$caret-icon-color: "808080"; // Without '#' !important
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23" + $caret-icon-color + "' 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");
background-position: center right .75rem;
background-repeat: no-repeat;
background-size: 1rem auto;
}
}
// Checkboxes & Radios
[type="checkbox"],
[type="radio"] {
display: inline-block;
width: 1rem;
height: 1rem;
margin-right: .375rem;
margin-bottom: $spacing-label-input;
vertical-align: middle;
cursor: pointer;
&::-ms-check {
display: none; // unstyle IE checkboxes
}
&:checked {
border-color: var(--primary);
background-color: var(--primary);
// Source: https://feathericons.com/
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFF' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
background-size: .66rem auto;
}
& ~ label {
display: inline-block;
margin-right: .375rem;
margin-bottom: 0;
cursor: pointer;
}
}
// Radios
[type="radio"] {
border-radius: 50%;
&:checked {
border-width: .33rem;
border-color: var(--primary);
background-color: var(--primary-inverse);
background-image: none;
}
}
// Switchs
[type="checkbox"][role="switch"] {
// Config
$switch-height: 1rem;
$switch-width: 1.85rem;
$switch-border: 2px;
$switch-transition: .1s ease-in-out;
// Styles
width: $switch-width;
height: $switch-height;
border: $switch-border solid var(--input-border);
border-radius: $switch-height;
background-color: var(--input-border);
line-height: $switch-height;
&:before {
display: block;
width: calc(#{$switch-height} - #{$switch-border*2});
height: 100%;
border-radius: 50%;
background-color: var(--primary-inverse);
content: '';
transition: margin $switch-transition;
}
&:checked {
border-color: var(--primary);
background-color: var(--primary);
// Disable if check box icon is needed
background-image: none;
// Enable if check box icon is needed
// background-position: center left $switch-width/6;
// background-size: $switch-width/5 auto;
&::before {
margin-right: 0;
margin-left: calc(#{$switch-width/2} - #{$switch-border});
}
}
}
// Helper
form small {
color: var(--muted-text);
}
input + small {
margin-top: -$spacing-typography/1.5;
margin-bottom: $spacing-typography;
}
// Styles for Input inside a label
label {
& > input:not([type="checkbox"]):not([type="radio"]),
& > select,
& > textarea {
margin-top: $spacing-label-input;
}
}

29
scss/content/_miscs.scss Normal file
View file

@ -0,0 +1,29 @@
/**
* Miscs
*/
// Reboot
// Based on normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
//
// 1. Add the correct box sizing in Firefox.
// 2. Show the overflow in Edge and IE.
hr {
box-sizing: content-box; // 1
height: 0; // 1
overflow: visible; // 2
border: none;
border-top: 1px solid var(--muted-border);
}
// Add the correct vertical alignment in Chrome, Firefox, and Opera.
progress {
vertical-align: baseline;
}
// Add the correct display in IE 10+.
[hidden],
template {
display: none;
}

45
scss/content/_table.scss Normal file
View file

@ -0,0 +1,45 @@
/**
* Table
*/
table {
width: 100%;
border-spacing: 0;
background: var(--table-background);
}
// Cells
th,
td {
padding: ($spacing-gutter/2) $spacing-gutter;
border-bottom: 1px solid var(--table-border);
color: var(--muted-text);
font-weight: $text-weight;
text-align: left;
font-size: 0.875rem;
}
// Titles
th,
thead td {
color: var(--text);
font-weight: bolder;
font-size: 1rem;
}
// First row
thead {
th,
td {
border-bottom: 3px solid var(--table-border);
}
}
// Fine striping
tbody tr:nth-child(odd) {
background-color: rgba($grey-50,.02);
}
thead tr,
tbody tr:nth-child(even) {
background-color: rgba($grey-900,.02);
}

View file

@ -0,0 +1,289 @@
/**
* Typography
*/
// Reboot
// Based on normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
//
// Add the correct font weight in Chrome, Edge, and Safari.
b,
strong {
font-weight: border;
}
// Prevent `sub` and `sup` elements from affecting the line height in all browsers.
sub,
sup {
position: relative;
font-size: .75rem;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25rem;
}
sup {
top: -0.5rem;
}
// 1. Remove the border on images inside links in IE 10.
// 2. Responsive by default
img {
max-width: 100%; // 2
height: auto; // 2
border-style: none; // 1
}
svg,
img {
vertical-align: text-bottom;
}
// Pico
//
address,
blockquote,
dl,
figure,
form,
ol,
p,
pre,
table,
ul {
margin-top: 0;
margin-bottom: $spacing-typography;
color: var(--text);
font-size: 1rem;
font-style: normal;
}
// Links
// 1. Remove the gray background on active links in IE 10.
a {
background-color: transparent; // 1
color: var(--primary);
text-decoration: none;
transition:
background-color $transition,
color $transition,
text-decoration $transition,
box-shadow $transition;
&:hover,
&:active,
&:focus {
color: var(--primary-hover);
text-decoration: underline;
}
&:focus {
outline: none;
background-color: var(--primary-focus);
}
}
// Link .secondary
@if $enable-classes {
a.secondary {
color: var(--secondary);
&:hover,
&:active,
&:focus {
color: var(--secondary-hover);
}
&:focus {
background-color: var(--secondary-focus);
}
}
}
// Headings
// Because vertical margins can collapse, we avoid `margin-top`
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: $spacing-typography;
font-weight: $heading-weight;
}
h1 {
margin-bottom: $spacing-typography*2;
color: var(--h1);
font-size: 2rem;
}
h2 {
margin-bottom: $spacing-typography*1.75;
color: var(--h2);
font-size: 1.75rem;
}
h3 {
margin-bottom: $spacing-typography*1.5;
color: var(--h3);
font-size: 1.5rem;
}
h4 {
margin-bottom: $spacing-typography*1.25;
color: var(--h4);
font-size: 1.25rem;
}
h5 {
margin-bottom: $spacing-typography*1.125;
color: var(--h5);
font-size: 1.125rem;
}
h6 {
color: var(--h6);
font-size: 1rem;
}
// Increase headings font size inside <header>
header {
h1 {
font-size: 2rem*1.5;
}
h2 {
font-size: 1.75rem*1.5;
}
h3 {
font-size: 1.5rem*1.5;
}
h4 {
font-size: 1.25rem*1.5;
}
h5 {
font-size: 1.125rem*1.5;
}
h6 {
font-size: 1rem*1.5;
}
}
// Multi-level heading
hgroup {
margin-bottom: $spacing-typography;
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin-bottom: 0;
}
}
// Paragraphs
p {
margin-bottom: $spacing-typography/2;
}
// Small
small {
font-size: 85%;
@if map-get($breakpoints, "sm") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "sm")) {
font-size: 83%;
}
}
@if map-get($breakpoints, "md") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "md")) {
font-size: 81%;
}
}
@if map-get($breakpoints, "lg") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "lg")) {
font-size: 79%;
}
}
@if map-get($breakpoints, "lg") and $enable-responsive-typography {
@media (min-width: map-get($breakpoints, "xl")) {
font-size: 77%;
}
}
}
// Lists
ul,
ol {
padding-left: $spacing-typography;
li {
margin-bottom: $spacing-typography/2;
}
}
ul li {
list-style: square;
}
// Marked text
mark {
padding: .125rem .25rem;
background: var(--mark);
color: var(--text);
vertical-align: middle;
}
// Blockquote
blockquote {
display: block;
margin: ($spacing-typography*2) 0;
margin-right: -$spacing-gutter;
margin-left: -$spacing-gutter;
padding: $spacing-gutter;
border-left: .25rem solid var(--muted-border);
@if map-get($breakpoints, "sm") {
@media (min-width: map-get($breakpoints, "sm")) {
margin-right: 0;
margin-left: 0;
}
}
footer {
margin-top: $spacing-typography/2;
color: var(--muted-text);
}
}
// Abbreviations
// 1. Remove underline decoration in Chrome, Edge, IE, Opera, and Safari.
abbr[title] {
border-bottom: 1px dotted;
text-decoration: none; // 1
cursor: help;
}
// Ins
ins {
color: var(--valid);
text-decoration: none;
}
// del
del {
color: var(--invalid);
}