Skip to content

Commit ee01dc2

Browse files
authored
theming.md: automate _root.scss. (twbs#29326)
1 parent 84cba07 commit ee01dc2

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

scss/_root.scss

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Do not forget to update getting-started/theming.md!
21
:root {
32
// Custom variable values only support SassScript inside `#{}`.
43
@each $color, $value in $colors {

site/content/docs/4.3/getting-started/theming.md

+7-25
Original file line numberDiff line numberDiff line change
@@ -369,31 +369,13 @@ Bootstrap 4 includes around two dozen [CSS custom properties (variables)](https:
369369
Here are the variables we include (note that the `:root` is required). They're located in our `_root.scss` file.
370370

371371
{{< highlight css >}}
372-
:root {
373-
--blue: #007bff;
374-
--indigo: #6610f2;
375-
--purple: #6f42c1;
376-
--pink: #e83e8c;
377-
--red: #dc3545;
378-
--orange: #fd7e14;
379-
--yellow: #ffc107;
380-
--green: #28a745;
381-
--teal: #20c997;
382-
--cyan: #17a2b8;
383-
--white: #fff;
384-
--gray: #6c757d;
385-
--gray-dark: #343a40;
386-
--primary: #007bff;
387-
--secondary: #6c757d;
388-
--success: #28a745;
389-
--info: #17a2b8;
390-
--warning: #ffc107;
391-
--danger: #dc3545;
392-
--light: #f8f9fa;
393-
--dark: #343a40;
394-
--font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
395-
--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
396-
}
372+
{{< root.inline >}}
373+
{{- $css := readFile "dist/css/bootstrap.css" -}}
374+
{{- $match := findRE ":root {([^}]*)}" $css 1 -}}
375+
376+
{{- index $match 0 -}}
377+
378+
{{< /root.inline >}}
397379
{{< /highlight >}}
398380

399381
### Examples

0 commit comments

Comments
 (0)