Skip to content

Instantly share code, notes, and snippets.

View nathanacurtis's full-sized avatar

Nathan Curtis nathanacurtis

View GitHub Profile
@nathanacurtis
nathanacurtis / Pill.styl
Last active February 4, 2020 04:59
Tokens01
.pill {
background-color: $background-color-light;
border: $border-hairline;
border-radius: $border-radius;
display: inline-block;
font-size: $font-size-metadata;
margin: $space-inline-left-xs;
padding: $space-inset-xs;
}
$color-neutral-20 = #222222;
$color-neutral-90 = #EEEEEE;
$font-size-m = 1rem;
$font-size-s = 0.875rem;
$space-m = 16px;
$space-l = 32px;
$background-color-dark = $color-neutral-20;
$background-color-light = $color-neutral-90;
$font-size-paragraph = $font-size-m;
$font-size-microcopy = $font-size-s;
$space-inset-default = 16px 16px 16px 16px;
$space-stack-l = 0 0 32px 0;
# Example partially complete token hierarchy (there are 100s of lines)
color :
white : &color-white "#FFFFFF"
black : &color-black "#262626"
neutral :
20 : &color-neutral-20 "#222222"
90 : &color-neutral-90 "#EEEEEE"
blue:
50: &color-blue-50 "#2196F3"
# Choices
color :
white : &color-white "#FFFFFF"
black : &color-black "#262626"
neutral :
20 : &color-neutral-20 "#222222"
90 : &color-neutral-90 "#EEEEEE"
blue:
50: &color-blue-50 "#2196F3"
color :
interactive-color :
background-color :
text-color :
font :
family :
size :
line-height :
border :
size :
space :
default : 16px
xxs: 2px
xs: 4px
s: 8px
m: 16px
l: 32px
xl: 64px
inset :
default : 16px 16px 16px 16px
$space-inset-default = 16px 16px 16px 16px;
$space-inset-xs = 4px 4px 4px 4px;
$space-inset-s = 8px 8px 8px 8px;
$space-inset-m = 16px 16px 16px 16px;
$space-inset-l = 32px 32px 32px 32px;
$space-inset-xl = 64px 64px 64px 64px;
$space-stack-default = 0 0 16px 0;
$space-stack-xs = 0 0 4px 0;
$space-stack-s = 0 0 8px 0;
$space-stack-m = 0 0 16px 0;
$system-background-color-light = #CFD8DC;
$system-text-color-primary-on-light = #222222;
$system-border-hairline-thin-on-dark = #455A64;
@nathanacurtis
nathanacurtis / text-color.scss
Last active May 4, 2019 12:26
Text Color Across Background Colors Mixin
@mixin text-color($type: 'primary') {
// Load background colors
$background-colors: tokens('background-color');
// Apply default text color
color: tokens('text-color', $type, 'on-white');