_variables.scss 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. @use 'sass:math';
  2. @use 'sass:map';
  3. @use 'sass:meta';
  4. @use '../tools/functions' as *;
  5. $color-pack: true !default;
  6. $reset: true !default;
  7. $layers: false !default;
  8. $body-font-family: 'Roboto', sans-serif !default;
  9. $font-size-root: 1rem !default;
  10. $line-height-root: 1.5 !default;
  11. $border-color-root: rgba(var(--v-border-color), var(--v-border-opacity)) !default;
  12. $border-radius-root: 4px !default;
  13. $border-style-root: solid !default;
  14. $border-width-root: thin !default;
  15. $transition-duration-root: 0.3s !default;
  16. $transition-move-duration-root: 0.5s !default;
  17. $borders: () !default;
  18. $borders: map-deep-merge(
  19. (
  20. 0: 0,
  21. null: $border-width-root,
  22. thin: $border-width-root,
  23. sm: 1px,
  24. md: 2px,
  25. lg: 4px,
  26. xl: 8px
  27. ),
  28. $borders
  29. );
  30. @each $key, $border in $borders {
  31. $borders: map-deep-merge(
  32. $borders,
  33. ( $key: $border $border-style-root $border-color-root )
  34. )
  35. }
  36. $border-opacities: () !default;
  37. $border-opacities: map-deep-merge(
  38. (
  39. 0: 0,
  40. null: .12,
  41. 25: .25,
  42. 50: .50,
  43. 75: .75,
  44. 100: 1
  45. ),
  46. $border-opacities
  47. );
  48. $opacities: () !default;
  49. $opacities: map-deep-merge(
  50. (
  51. hover: var(--v-hover-opacity),
  52. focus: var(--v-focus-opacity),
  53. selected: var(--v-selected-opacity),
  54. activated: var(--v-activated-opacity),
  55. pressed: var(--v-pressed-opacity),
  56. dragged: var(--v-dragged-opacity),
  57. 0: 0,
  58. 10: .1,
  59. 20: .2,
  60. 30: .3,
  61. 40: .4,
  62. 50: .5,
  63. 60: .6,
  64. 70: .7,
  65. 80: .8,
  66. 90: .9,
  67. 100: 1
  68. ),
  69. $opacities
  70. );
  71. $states: () !default;
  72. $states: map-deep-merge(
  73. (
  74. 'hover': var(--v-hover-opacity),
  75. 'focus': var(--v-focus-opacity),
  76. 'selected': var(--v-selected-opacity),
  77. 'activated': var(--v-activated-opacity),
  78. 'pressed': var(--v-pressed-opacity),
  79. 'dragged': var(--v-dragged-opacity)
  80. ),
  81. $states
  82. );
  83. $rounded: () !default;
  84. $rounded: map-deep-merge(
  85. (
  86. 0: 0,
  87. 'sm': $border-radius-root * .5,
  88. null: $border-radius-root,
  89. 'lg': $border-radius-root * 2,
  90. 'xl': $border-radius-root * 6,
  91. 'pill': 9999px,
  92. 'circle': 50%,
  93. 'shaped': $border-radius-root * 6 0
  94. ),
  95. $rounded
  96. );
  97. $spacer: 4px !default;
  98. $spacers-steps: 16 !default;
  99. $spacers: () !default;
  100. @if (meta.type-of($spacers) == list) {
  101. @for $i from 0 through $spacers-steps {
  102. $spacers: map.merge($spacers, ($i: $spacer * $i))
  103. }
  104. }
  105. $negative-spacers: () !default;
  106. @if (meta.type-of($negative-spacers) == list) {
  107. @for $i from 1 through $spacers-steps {
  108. $negative-spacers: map.merge($negative-spacers, ("n" + $i: -$spacer * $i))
  109. }
  110. }
  111. $grid-breakpoints: () !default;
  112. $grid-breakpoints: map-deep-merge(
  113. (
  114. 'xs': 0,
  115. 'sm': 600px,
  116. 'md': 960px,
  117. 'lg': 1280px,
  118. 'xl': 1920px,
  119. 'xxl': 2560px,
  120. ),
  121. $grid-breakpoints
  122. );
  123. $grid-gutter: $spacer * 6 !default;
  124. $form-grid-gutter: $spacer * 2 !default;
  125. $grid-columns: 12 !default;
  126. $container-padding-x: $spacer * 4 !default;
  127. $grid-gutters: () !default;
  128. $grid-gutters: map-deep-merge(
  129. (
  130. 'xs': math.div($grid-gutter, 12),
  131. 'sm': math.div($grid-gutter, 6),
  132. 'md': math.div($grid-gutter, 3),
  133. 'lg': math.div($grid-gutter * 2, 3),
  134. 'xl': $grid-gutter,
  135. ),
  136. $grid-gutters
  137. );
  138. $container-max-widths: () !default;
  139. $container-max-widths: map-deep-merge(
  140. (
  141. 'xs': null,
  142. 'sm': null,
  143. 'md': map.get($grid-breakpoints, 'md') * 0.9375,
  144. 'lg': map.get($grid-breakpoints, 'lg') * 0.9375,
  145. 'xl': map.get($grid-breakpoints, 'xl') * 0.9375,
  146. 'xxl': map.get($grid-breakpoints, 'xxl') * 0.9375,
  147. ),
  148. $container-max-widths
  149. );
  150. // Avoid using *-and-down where possible
  151. $display-breakpoints: () !default;
  152. $display-breakpoints: map-deep-merge(
  153. (
  154. 'print-only': 'only print',
  155. 'screen-only': 'only screen',
  156. 'xs': '(max-width: #{map.get($grid-breakpoints, 'sm') - 0.02})',
  157. 'sm': '(min-width: #{map.get($grid-breakpoints, 'sm')}) and (max-width: #{map.get($grid-breakpoints, 'md') - 0.02})',
  158. 'md': '(min-width: #{map.get($grid-breakpoints, 'md')}) and (max-width: #{map.get($grid-breakpoints, 'lg') - 0.02})',
  159. 'lg': '(min-width: #{map.get($grid-breakpoints, 'lg')}) and (max-width: #{map.get($grid-breakpoints, 'xl') - 0.02})',
  160. 'xl': '(min-width: #{map.get($grid-breakpoints, 'xl')}) and (max-width: #{map.get($grid-breakpoints, 'xxl') - 0.02})',
  161. 'xxl': '(min-width: #{map.get($grid-breakpoints, 'xxl')})',
  162. 'sm-and-up': '(min-width: #{map.get($grid-breakpoints, 'sm')})',
  163. 'md-and-up': '(min-width: #{map.get($grid-breakpoints, 'md')})',
  164. 'lg-and-up': '(min-width: #{map.get($grid-breakpoints, 'lg')})',
  165. 'xl-and-up': '(min-width: #{map.get($grid-breakpoints, 'xl')})',
  166. 'sm-and-down': '(max-width: #{map.get($grid-breakpoints, 'md') - 0.02})',
  167. 'md-and-down': '(max-width: #{map.get($grid-breakpoints, 'lg') - 0.02})',
  168. 'lg-and-down': '(max-width: #{map.get($grid-breakpoints, 'xl') - 0.02})',
  169. 'xl-and-down': '(max-width: #{map.get($grid-breakpoints, 'xxl') - 0.02})',
  170. ),
  171. $display-breakpoints
  172. );
  173. $font-weights: () !default;
  174. $font-weights: map-deep-merge(
  175. (
  176. 'thin': 100,
  177. 'light': 300,
  178. 'regular': 400,
  179. 'medium': 500,
  180. 'bold': 700,
  181. 'black': 900
  182. ),
  183. $font-weights
  184. );
  185. $heading-font-family: $body-font-family !default;
  186. $typography: () !default;
  187. $typography: map-deep-merge(
  188. (
  189. 'h1': (
  190. 'size': 6rem,
  191. 'weight': 300,
  192. 'line-height': 1,
  193. 'letter-spacing': -.015625em,
  194. 'font-family': $heading-font-family,
  195. 'text-transform': none
  196. ),
  197. 'h2': (
  198. 'size': 3.75rem,
  199. 'weight': 300,
  200. 'line-height': 1,
  201. 'letter-spacing': -.0083333333em,
  202. 'font-family': $heading-font-family,
  203. 'text-transform': none
  204. ),
  205. 'h3': (
  206. 'size': 3rem,
  207. 'weight': 400,
  208. 'line-height': 1.05,
  209. 'letter-spacing': normal,
  210. 'font-family': $heading-font-family,
  211. 'text-transform': none
  212. ),
  213. 'h4': (
  214. 'size': 2.125rem,
  215. 'weight': 400,
  216. 'line-height': 1.175,
  217. 'letter-spacing': .0073529412em,
  218. 'font-family': $heading-font-family,
  219. 'text-transform': none
  220. ),
  221. 'h5': (
  222. 'size': 1.5rem,
  223. 'weight': 400,
  224. 'line-height': 1.333,
  225. 'letter-spacing': normal,
  226. 'font-family': $heading-font-family,
  227. 'text-transform': none
  228. ),
  229. 'h6': (
  230. 'size': 1.25rem,
  231. 'weight': 500,
  232. 'line-height': 1.6,
  233. 'letter-spacing': .0125em,
  234. 'font-family': $heading-font-family,
  235. 'text-transform': none
  236. ),
  237. 'subtitle-1': (
  238. 'size': 1rem,
  239. 'weight': normal,
  240. 'line-height': 1.75,
  241. 'letter-spacing': .009375em,
  242. 'font-family': $body-font-family,
  243. 'text-transform': none
  244. ),
  245. 'subtitle-2': (
  246. 'size': .875rem,
  247. 'weight': 500,
  248. 'line-height': 1.6,
  249. 'letter-spacing': .0071428571em,
  250. 'font-family': $body-font-family,
  251. 'text-transform': none
  252. ),
  253. 'body-1': (
  254. 'size': 1rem,
  255. 'weight': 400,
  256. 'line-height': 1.5,
  257. 'letter-spacing': .03125em,
  258. 'font-family': $body-font-family,
  259. 'text-transform': none
  260. ),
  261. 'body-2': (
  262. 'size': .875rem,
  263. 'weight': 400,
  264. 'line-height': 1.425,
  265. 'letter-spacing': .0178571429em,
  266. 'font-family': $body-font-family,
  267. 'text-transform': none
  268. ),
  269. 'button': (
  270. 'size': .875rem,
  271. 'weight': 500,
  272. 'line-height': 2.6,
  273. 'letter-spacing': .0892857143em,
  274. 'font-family': $body-font-family,
  275. 'text-transform': uppercase
  276. ),
  277. 'caption': (
  278. 'size': .75rem,
  279. 'weight': 400,
  280. 'line-height': 1.667,
  281. 'letter-spacing': .0333333333em,
  282. 'font-family': $body-font-family,
  283. 'text-transform': none
  284. ),
  285. 'overline': (
  286. 'size': .75rem,
  287. 'weight': 500,
  288. 'line-height': 2.667,
  289. 'letter-spacing': .1666666667em,
  290. 'font-family': $body-font-family,
  291. 'text-transform': uppercase
  292. )
  293. ),
  294. $typography
  295. );
  296. $flat-typography: () !default;
  297. @each $type, $values in $typography {
  298. $flat-typography: map-deep-merge(
  299. $flat-typography,
  300. (#{$type}: (
  301. map.get($values, 'size'),
  302. map.get($values, 'weight'),
  303. map.get($values, 'line-height'),
  304. map.get($values, 'letter-spacing'),
  305. map.get($values, 'font-family'),
  306. map.get($values, 'text-transform'),
  307. ))
  308. );
  309. }
  310. // Mapping from transition to easings:
  311. // fast-out-slow-in -> standard
  312. // linear-out-slow-in -> decelerated
  313. // fast-out-linear-in -> accelerated
  314. // ease-in-out -> standard or accelerated depending on usage
  315. // fast-in-fast-out -> accelerated
  316. // swing -> standard
  317. $standard-easing: cubic-bezier(0.4, 0, 0.2, 1) !default;
  318. $decelerated-easing: cubic-bezier(0.0, 0, 0.2, 1) !default; // Entering
  319. $accelerated-easing: cubic-bezier(0.4, 0, 1, 1) !default; // Leaving
  320. // Elements
  321. $bootable-transition: 0.2s $decelerated-easing !default;
  322. $blockquote-font-size: 18px !default;
  323. $blockquote-font-weight: 300 !default;
  324. $sizes: (
  325. 'x-small',
  326. 'small',
  327. 'default',
  328. 'large',
  329. 'x-large'
  330. ) !default;
  331. $size-scale: $spacer * 2 !default;
  332. $size-scales: (
  333. 'x-small': -2,
  334. 'small': -1,
  335. 'default': 0,
  336. 'large': 1,
  337. 'x-large': 2
  338. ) !default;