You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/customize/color-modes.md
+41-1
Original file line number
Diff line number
Diff line change
@@ -195,6 +195,46 @@ Adding a new color in `$theme-colors` is not enough for some of our components l
195
195
196
196
This is a manual process because Sass cannot generate its own Sass variables from an existing variable or map. In future versions of Bootstrap, we'll revisit this setup to reduce the duplication.
Copy file name to clipboardExpand all lines: docs/content/customize/sass.md
+95
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,41 @@ your-project/
37
37
38
38
In your `custom.scss`, you'll import CoreUI's source Sass files. You have two options: include all of CoreUI, or pick the parts you need. We encourage the latter, though be aware there are some requirements and dependencies across our components. You also will need to include some JavaScript for our plugins.
39
39
40
+
{{< callout-dart-sass-modules >}}
41
+
42
+
```scss
43
+
// Custom.scss
44
+
// Option A: Include all of CoreUI
45
+
46
+
@use"@coreui/coreui/scss/coreui";
47
+
48
+
// Then add additional custom code here
49
+
```
50
+
51
+
```scss
52
+
// Custom.scss
53
+
// Option B: Include parts of CoreUI
54
+
55
+
// 1. Include
56
+
@use"@coreui/coreui/scss/root";
57
+
58
+
// 2. Optionally include any other parts as needed
59
+
@use"@coreui/coreui/scss/utilities";
60
+
@use"@coreui/coreui/scss/reboot";
61
+
@use"@coreui/coreui/scss/type";
62
+
@use"@coreui/coreui/scss/images";
63
+
@use"@coreui/coreui/scss/containers";
64
+
@use"@coreui/coreui/scss/grid";
65
+
@use"@coreui/coreui/scss/helpers";
66
+
67
+
// 3. Optionally include utilities API last to generate classes based on the Sass map in `_utilities.scss`
68
+
@use"@coreui/coreui/scss/utilities/api";
69
+
70
+
// 4. Add additional custom code here
71
+
```
72
+
73
+
{{< callout-dart-sass-deprecations >}}
74
+
40
75
```scss
41
76
// Custom.scss
42
77
// Option A: Include all of CoreUI
@@ -125,6 +160,17 @@ Variable overrides must come after our functions are imported, but before the re
125
160
126
161
Here's an example that changes the `background-color` and `color` for the `<body>` when importing and compiling CoreUI for Bootstrap via npm:
Add new colors to `$theme-colors`, or any other map, by creating a new Sass map with your custom values and merging it with the original map. In this case, we'll create a new `$custom-colors` map and merge it with `$theme-colors`.
@@ -231,6 +309,8 @@ You can lighten or darken colors with CoreUI for Bootstrap's `tint-color()` and
231
309
In practice, you'd call the function and pass in the color and weight parameters.
232
310
233
311
```scss
312
+
@use"@coreui/coreui/scss/functions/color"as*;
313
+
234
314
.custom-element {
235
315
color: tint-color($primary, 10%);
236
316
}
@@ -251,9 +331,14 @@ In order to meet the [Web Content Accessibility Guidelines (WCAG)](https://www.w
251
331
252
332
An additional function we include in CoreUI for Bootstrap is the color contrast function, `color-contrast`. It utilizes the [WCAG 2.0 algorithm](https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests) for calculating contrast thresholds based on [relative luminance](https://www.w3.org/WAI/GL/wiki/Relative_luminance) in a `sRGB` colorspace to automatically return a light (`#fff`), dark (`#212529`) or black (`#000`) contrast color based on the specified base color. This function is especially useful for mixins or loops where you're generating multiple classes.
<strong>Sass <code>@import</code> are deprecated and will be removed in Dart Sass 3.0.0.!</strong>
4
+
</p>
5
+
<p>You can also use <code>@import</code> rules, but please be aware that they are deprecated and will be removed in Dart Sass 3.0.0, resulting in a compilation warning. You can learn more about this deprecation <ahref="https://sass-lang.com/documentation/breaking-changes/import/" target="_blank">here</a>.</p>
<strong>Heads up!</strong> Since <code>@coreui/coreui</code> v5.3.0 and <code>@coreui/coreui-pro</code> v5.10.0, we support Sass modules.
4
+
</p>
5
+
<p>
6
+
You can now use the modern <code>@use</code> and <code>@forward</code> rules instead of <code>@import</code>, which is deprecated and will be removed in Dart Sass 3.0.0. Using <code>@import</code> will result in a compilation warning. You can learn more about this transition <ahref="https://sass-lang.com/documentation/breaking-changes/import/" target="_blank">here</a>.
0 commit comments