Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
XhmikosR
8f6643c40f
Update .bundlewatch.config.json 2020-12-12 10:39:46 +02:00
XhmikosR
fa9c156464
Merge branch 'main' into css-vars 2020-12-12 10:38:53 +02:00
XhmikosR
ec6e3fba03
Update .bundlewatch.config.json 2020-12-12 10:38:12 +02:00
Mark Otto
ffc9371be5 WIP implementation of more CSS vars 2020-12-10 12:59:18 -08:00
3 changed files with 28 additions and 6 deletions

View file

@ -26,7 +26,7 @@
// null by default, thus nothing is generated. // null by default, thus nothing is generated.
:root { :root {
font-size: $font-size-root; font-size: var(--root-font-size);
@if $enable-smooth-scroll { @if $enable-smooth-scroll {
@media (prefers-reduced-motion: no-preference) { @media (prefers-reduced-motion: no-preference) {
@ -45,13 +45,13 @@
body { body {
margin: 0; // 1 margin: 0; // 1
font-family: $font-family-base; font-family: var(--bs-body-font);
@include font-size($font-size-base); @include font-size(var(--bs-body-font-size));
font-weight: $font-weight-base; font-weight: $font-weight-base;
line-height: $line-height-base; line-height: $line-height-base;
color: $body-color; color: var(--bs-body-color);
text-align: $body-text-align; text-align: $body-text-align;
background-color: $body-bg; // 2 background-color: var(--bs-body-bg); // 2
-webkit-text-size-adjust: 100%; // 3 -webkit-text-size-adjust: 100%; // 3
-webkit-tap-highlight-color: rgba($black, 0); // 4 -webkit-tap-highlight-color: rgba($black, 0); // 4
} }

View file

@ -4,6 +4,10 @@
--#{$variable-prefix}#{$color}: #{$value}; --#{$variable-prefix}#{$color}: #{$value};
} }
@each $color, $value in $grays {
--#{$variable-prefix}#{$color}: #{$value};
}
@each $color, $value in $theme-colors { @each $color, $value in $theme-colors {
--#{$variable-prefix}#{$color}: #{$value}; --#{$variable-prefix}#{$color}: #{$value};
} }
@ -13,4 +17,22 @@
--#{$variable-prefix}font-sans-serif: #{inspect($font-family-sans-serif)}; --#{$variable-prefix}font-sans-serif: #{inspect($font-family-sans-serif)};
--#{$variable-prefix}font-monospace: #{inspect($font-family-monospace)}; --#{$variable-prefix}font-monospace: #{inspect($font-family-monospace)};
--#{$variable-prefix}gradient: #{$gradient}; --#{$variable-prefix}gradient: #{$gradient};
// Root and body
--#{$variable-prefix}root-font-size: #{$font-size-root};
--#{$variable-prefix}body-font: #{$font-family-base};
--#{$variable-prefix}body-font-size: #{$font-size-base};
--#{$variable-prefix}body-color: #{$body-color};
--#{$variable-prefix}body-bg: #{$body-bg};
// Layout
--#{$variable-prefix}grid-columns: #{$grid-columns};
--#{$variable-prefix}grid-gutter-width: #{$grid-gutter-width};
// Spacing
// TODO: Ideally we'd size these values based on the CSS var instead of the Sass map, so they'd be live updating, but TBD on feasibility
--#{$variable-prefix}spacer: #{$spacer};
@each $size, $value in $spacers {
--#{$variable-prefix}spacer-#{$size}: #{$value};
}
} }

View file

@ -2,7 +2,7 @@
// //
// Generate semantic grid columns with these mixins. // Generate semantic grid columns with these mixins.
@mixin make-row($gutter: $grid-gutter-width) { @mixin make-row($gutter: var(--bs-grid-gutter-width)) {
--#{$variable-prefix}gutter-x: #{$gutter}; --#{$variable-prefix}gutter-x: #{$gutter};
--#{$variable-prefix}gutter-y: 0; --#{$variable-prefix}gutter-y: 0;
display: flex; display: flex;