Skip to content

Commit

Permalink
Escape SassScript in custom variable values (twbs#24354)
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm authored Oct 14, 2017
1 parent 71e60e1 commit a9fa21e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scss/_root.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
:root {
// Custom variable values only support SassScript inside `#{}`.
@each $color, $value in $colors {
--#{$color}: $value;
--#{$color}: #{$value};
}

@each $color, $value in $theme-colors {
--#{$color}: $value;
--#{$color}: #{$value};
}

@each $bp, $value in $grid-breakpoints {
--breakpoint-#{$bp}: $value;
--breakpoint-#{$bp}: #{$value};
}

--font-family-sans-serif: $font-family-sans-serif;
--font-family-monospace: $font-family-monospace;
// Use `inspect` for lists so that quoted items keep the quotes.
// See https://github.com/sass/sass/issues/2383#issuecomment-336349172
--font-family-sans-serif: #{inspect($font-family-sans-serif)};
--font-family-monospace: #{inspect($font-family-monospace)};
}

0 comments on commit a9fa21e

Please sign in to comment.