|
1 | 1 | import { css } from 'vue-styled-components'
|
2 |
| -import { breakpoints } from './theme' |
| 2 | +import { breakpoints, fonts, colors } from './theme' |
| 3 | +import chroma from 'chroma-js' |
3 | 4 |
|
4 | 5 | // Media Queries
|
5 | 6 | export const media = {
|
@@ -39,3 +40,147 @@ export const media = {
|
39 | 40 | }
|
40 | 41 | `
|
41 | 42 | }
|
| 43 | + |
| 44 | +// FLEX LAYOUT |
| 45 | +export const flexColumn = css` |
| 46 | + display: flex; |
| 47 | + flex-direction: column; |
| 48 | +` |
| 49 | +export const flexColumnCentered = css` |
| 50 | + ${flexColumn}; |
| 51 | + align-items: center; |
| 52 | +` |
| 53 | + |
| 54 | +export const flexRow = css` |
| 55 | + display: flex; |
| 56 | + flex-direction: row; |
| 57 | +` |
| 58 | + |
| 59 | +export const flexRowWrap = css` |
| 60 | + ${flexRow}; |
| 61 | + flex-wrap: wrap; |
| 62 | +` |
| 63 | + |
| 64 | +export const flexRowCenteredVert = css` |
| 65 | + ${flexRow}; |
| 66 | + align-items: center; |
| 67 | +` |
| 68 | + |
| 69 | +export const flexRowCenteredAll = css` |
| 70 | + ${flexRowCenteredVert}; |
| 71 | + justify-content: center; |
| 72 | +` |
| 73 | + |
| 74 | +export const flexRowSpaceBetween = css` |
| 75 | + ${flexRow}; |
| 76 | + justify-content: space-between; |
| 77 | +` |
| 78 | + |
| 79 | +// TYPOGRAPHY |
| 80 | +export const sansFont = css` |
| 81 | + font-family: ${fonts.sans}; |
| 82 | + font-weight: 700; |
| 83 | + text-transform: lowercase; |
| 84 | +` |
| 85 | + |
| 86 | +export const bigType = css` |
| 87 | + font-size: ${fonts.sizes.lg}; |
| 88 | + font-family: ${fonts.sans}; |
| 89 | + line-height: 1.1; |
| 90 | + font-weight: bold; |
| 91 | + word-spacing: .5vmin; |
| 92 | + letter-spacing: .125vmin; |
| 93 | + margin-bottom: 3vmin; |
| 94 | + display: block; |
| 95 | + position: relative; |
| 96 | + ${media.small` |
| 97 | + font-size: 3.5rem; |
| 98 | + margin: 3.5rem 0; |
| 99 | + `} |
| 100 | +` |
| 101 | + |
| 102 | +export const lgBodyCopy = css` |
| 103 | + font-size: ${fonts.sizes.med_lg}; |
| 104 | + font-family: ${fonts.sans}; |
| 105 | + font-weight: 500; |
| 106 | + line-height: 1.35; |
| 107 | +` |
| 108 | + |
| 109 | +export const mediumType = css` |
| 110 | + font-size: ${fonts.sizes.med}; |
| 111 | + font-family: ${fonts.sans}; |
| 112 | + font-weight: 500; |
| 113 | + line-height: 1.45; |
| 114 | +` |
| 115 | + |
| 116 | +export const smallType = css` |
| 117 | + font-size: ${fonts.sizes.sm}; |
| 118 | + font-family: ${fonts.sans}; |
| 119 | + line-height: .8; |
| 120 | +` |
| 121 | + |
| 122 | +export const microType = css` |
| 123 | + font-size: ${fonts.sizes.micro}; |
| 124 | + font-family: ${fonts.sans}; |
| 125 | + line-height: .8; |
| 126 | + letter-spacing: 1px; |
| 127 | + word-spacing: 2px; |
| 128 | + font-weight: 400; |
| 129 | +` |
| 130 | + |
| 131 | +export const linkInit = css` |
| 132 | + -webkit-tap-highlight-color: rgba(255,255,255,0); |
| 133 | + -webkit-appearance: none; |
| 134 | + border: 0; |
| 135 | + background-color: rgba(255,255,255,0); |
| 136 | + text-decoration: none; |
| 137 | + position: relative; |
| 138 | + display: block; |
| 139 | + cursor: pointer; |
| 140 | + &:hover { |
| 141 | + text-decoration: none; |
| 142 | + } |
| 143 | +` |
| 144 | + |
| 145 | +export const buttonInit = css` |
| 146 | + ${linkInit}; |
| 147 | + border-radius: 0; |
| 148 | + appearance: none; |
| 149 | +` |
| 150 | + |
| 151 | +export const buttonStyle = css` |
| 152 | + ${buttonInit}; |
| 153 | + ${microType}; |
| 154 | + ${flexRowCenteredAll}; |
| 155 | + color: ${colors.white}; |
| 156 | + text-transform: uppercase; |
| 157 | + height: 3rem; |
| 158 | + background-color: ${chroma(colors.blue).darken(0.2)}; |
| 159 | + color: ${colors.white}; |
| 160 | + border-radius: 1.5rem; |
| 161 | + will-change: background-color; |
| 162 | + transition: background-color 250ms ease; |
| 163 | + width: 10.5rem; |
| 164 | + text-decoration: none; |
| 165 | + span { |
| 166 | + padding-top: 2px; |
| 167 | + } |
| 168 | + &:hover { |
| 169 | + background-color: ${chroma(colors.blue).darken(1.5)}; |
| 170 | + } |
| 171 | + &.active { |
| 172 | + background-color: ${chroma(colors.blue).darken(0.5)}; |
| 173 | + } |
| 174 | + ${media.small` |
| 175 | + background-color: ${chroma(colors.blue).darken(1.125)}; |
| 176 | + width: auto; |
| 177 | + min-width: 10rem; |
| 178 | + padding: 0 1.5rem; |
| 179 | + span { |
| 180 | + padding-top: 2px; |
| 181 | + } |
| 182 | + &.active { |
| 183 | + background-color: ${chroma(colors.blue).darken(1.5)}; |
| 184 | + } |
| 185 | + `} |
| 186 | +` |
0 commit comments