Skip to content

Commit

Permalink
✨ feat(modifiers.scss): Add border color and opacity utility classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderpig86 committed Sep 28, 2022
1 parent eff211e commit ae26f16
Show file tree
Hide file tree
Showing 12 changed files with 1,467 additions and 277 deletions.
719 changes: 628 additions & 91 deletions dist/cirrus-all.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cirrus-all.min.css

Large diffs are not rendered by default.

499 changes: 408 additions & 91 deletions dist/cirrus-core.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cirrus-core.min.css

Large diffs are not rendered by default.

499 changes: 408 additions & 91 deletions dist/cirrus.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cirrus.min.css

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/base/modifiers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@
}

.text-#{$name}-#{$level} {
border-color: rgba(#{hex-to-rgb($color)}, var(--color-opacity)) !important;
color: rgba(#{hex-to-rgb($color)}, var(--color-opacity)) !important;
}

.border-#{$name}-#{$level} {
border-color: rgba(#{hex-to-rgb($color)}, var(--border-opacity)) !important;
}
}
}
}
1 change: 1 addition & 0 deletions src/cirrus-all.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
OPACITY: true,
BACKGROUND-OPACITY: true,
COLOR-OPACITY: true,
BORDER-OPACITY: true,
WIDTHS: true,
HEIGHTS: true,
ZINDEX: true,
Expand Down
2 changes: 2 additions & 0 deletions src/cirrus-ext.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@forward "internal";

// Uses default config in _config.scss

@forward "builds/core.scss";
@forward "builds/ext.scss";
1 change: 1 addition & 0 deletions src/internal/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $default-config: (
flags.$OPACITY: true,
flags.$BACKGROUND-OPACITY: false,
flags.$COLOR-OPACITY: false,
flags.$BORDER-OPACITY: false,
flags.$WIDTHS: true,
flags.$HEIGHTS: true,
flags.$ZINDEX: false,
Expand Down
1 change: 1 addition & 0 deletions src/internal/_flags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ $TEXT: 'TEXT';
$OPACITY: 'OPACITY';
$BACKGROUND-OPACITY: 'BACKGROUND-OPACITY';
$COLOR-OPACITY: 'COLOR-OPACITY';
$BORDER-OPACITY: 'BORDER-OPACITY';
$ZINDEX: 'ZINDEX';
$ABSOLUTES: 'ABSOLUTES';
$GAP: 'GAP';
Expand Down
11 changes: 11 additions & 0 deletions src/utils/opacity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,14 @@ $generate-utility: should-generate-classes($COLOR-OPACITY);
$include-important: false
);
}

$generate-utility: should-generate-classes($BORDER-OPACITY);
@if $generate-utility {
@include generate-classes-for-viewport-with-map(
$opacities,
'--border-opacity',
'u-border-opacity-',
$generate-viewports: #{get-viewport-flag($BORDER-OPACITY)},
$include-important: false
);
}

0 comments on commit ae26f16

Please sign in to comment.