Skip to content

Commit bc1b076

Browse files
committed
refactor(Callout): update CSS Variables
1 parent 0d831a9 commit bc1b076

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

docs/content/components/callout.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ Callout component is prepared for any length of text, as well as an optional ele
2626

2727
## Customizing
2828

29-
### CSS variables
29+
### CSS Variables
3030

31-
Callouts use local CSS variables on .callout for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
31+
Callouts use local CSS variables on `.callout` for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.
32+
33+
{{< scss-docs name="callout-css-vars" file="scss/_callout.scss" >}}
34+
35+
### SASS variables
3236

33-
{{< css-vars-docs file="scss/_callout.scss" >}}
34-
### SASS
3537
{{< scss-docs name="callout-variables" file="scss/_variables.scss" >}}
3638

3739
#### Variants

scss/_callout.scss

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
.callout {
2-
padding: $callout-padding-y $callout-padding-x;
3-
margin: $callout-margin-y $callout-margin-x;
4-
border: var(--#{$prefix}callout-border-width, $callout-border-width) solid var(--#{$prefix}callout-border-color, $callout-border-color);
5-
@include ltr-rtl("border-left-width", var(--#{$prefix}callout-border-left-width, $callout-border-left-width));
6-
@include border-radius($callout-border-radius);
2+
// scss-docs-start callout-css-vars
3+
--#{$prefix}callout-padding-x: #{$callout-padding-x};
4+
--#{$prefix}callout-padding-y: #{$callout-padding-y};
5+
--#{$prefix}callout-margin-x: #{$callout-margin-x};
6+
--#{$prefix}callout-margin-y: #{$callout-margin-y};
7+
--#{$prefix}callout-border-width: #{$callout-border-width};
8+
--#{$prefix}callout-border-color: #{$callout-border-color};
9+
--#{$prefix}callout-border-left-width: #{$callout-border-left-width};
10+
--#{$prefix}callout-border-radius: #{$callout-border-radius};
11+
// scss-docs-end callout-css-vars
12+
13+
padding: var(--#{$prefix}callout-padding-y) var(--#{$prefix}callout-padding-x);
14+
margin: var(--#{$prefix}callout-margin-y) var(--#{$prefix}callout-margin-x);
15+
border: var(--#{$prefix}callout-border-width) solid var(--#{$prefix}callout-border-color);
16+
@include ltr-rtl("border-left-width", var(--#{$prefix}callout-border-left-width));
17+
@include ltr-rtl("border-left-color", var(--#{$prefix}callout-border-left-color));
18+
@include border-radius(var(--#{$prefix}callout-border-radius));
719
}
820

921
// scss-docs-start callout-modifiers
1022
// Generate contextual modifier classes for colorizing the collor.
1123
@each $state, $value in $callout-variants {
1224
.callout-#{$state} {
13-
@include ltr-rtl("border-left-color", var(--#{$prefix}callout-border-left-color, $value));
25+
--#{$prefix}callout-border-left-color: #{$value};
1426
}
1527
}
1628
// scss-docs-end callout-modifiers

0 commit comments

Comments
 (0)