Skip to content

Commit d2c8599

Browse files
committed
refactor: migrate from import to Sass modules system
1 parent c9d9b51 commit d2c8599

File tree

88 files changed

+967
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+967
-448
lines changed

docs/assets/scss/_colors.scss

Lines changed: 119 additions & 115 deletions
Large diffs are not rendered by default.

docs/content/components/buttons.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -307,48 +307,6 @@ Here's an example of building a custom `.btn-*` modifier class like we do for th
307307

308308
{{< scss-docs name="btn-variables" file="scss/_variables.scss" >}}
309309

310-
### SASS variants
311-
312-
CoreUI allows defining variant colors in two ways.
313-
314-
#### Manual
315-
316-
You can define each color manually and keep full control of the component appearance.
317-
318-
{{< highlight scss >}}
319-
$button-variants: (
320-
"primary": (
321-
"background": $your-bg-color,
322-
"border": $your-border-color,
323-
"color": $your-color,
324-
"hover-background": $your-bg-hover-color,
325-
"hover-border": $your-hover-border-color,
326-
"hover-color": $your-hover-color,
327-
"active-background": $your-bg-active-color,
328-
"active-border": $your-active-border-color,
329-
"active-color": $your-active-color,
330-
"disabled-background": $your-bg-disabled-color,,
331-
"disabled-border": $your-disabled-border-color,
332-
"disabled-color": $your-disabled-color,
333-
"shadow": $your-shadow
334-
)
335-
...
336-
);
337-
{{< /highlight >}}
338-
339-
#### Color function
340-
341-
The color set can be generated automatically thanks to our `button-color-map` function.
342-
343-
{{< scss-docs name="button-color-functions" file="scss/_functions.scss" >}}
344-
345-
{{< highlight scss >}}
346-
$button-variants: (
347-
"primary": btn-color-map($primary),
348-
...
349-
);
350-
{{< /highlight >}} -->
351-
352310
### SASS mixins
353311

354312
CoreUI's button component is built with a base-modifier class approach. This means the bulk of the styling is contained to a base class `.btn` while style variations are confined to modifier classes (e.g., `.btn-danger`). These modifier classes are built from the `$button-variants` map to make customizing the number and name of our modifier classes.
@@ -367,6 +325,4 @@ There are three mixins for buttons: button and button outline variant mixins, pl
367325

368326
Button variants (for regular and outline buttons) use their respective mixins with our `$theme-colors` map to generate the modifier classes in `scss/_buttons.scss`.
369327

370-
{{< scss-docs name="button-variants" file="scss/_variables.scss" >}}
371-
372328
{{< scss-docs name="btn-variant-loops" file="scss/_buttons.scss" >}}

docs/content/customize/sass.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Next to the [Sass maps]({{< docsref "/customize/color#color-sass-maps" >}}) we h
226226

227227
You can lighten or darken colors with CoreUI for Bootstrap's `tint-color()` and `shade-color()` functions. These functions will mix colors with black or white, unlike Sass' native `lighten()` and `darken()` functions which will change the lightness by a fixed amount, which often doesn't lead to the desired effect.
228228

229-
{{< scss-docs name="color-functions" file="scss/_functions.scss" >}}
229+
{{< scss-docs name="color-functions" file="scss/functions/_color.scss" >}}
230230

231231
In practice, you'd call the function and pass in the color and weight parameters.
232232

docs/layouts/partials/stylesheet.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<link href="/dist/css/coreui{{ if eq .Page.Params.direction "rtl" }}.rtl{{ end }}.css" rel="stylesheet">
1010
{{- end }}
1111

12-
{{- $sassOptions := dict "outputStyle" "expanded" "precision" 6 -}}
12+
{{- $sassOptions := dict "transpiler" "dartsass" "outputStyle" "expanded" "precision" 6 -}}
1313
{{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}
1414

1515
{{- $targetDocsCssPath := "/assets/css/docs.css" -}}

0 commit comments

Comments
 (0)