Skip to content

Commit

Permalink
✨ feat(blur.scss): Add blur utility classes with viewport disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderpig86 committed Sep 4, 2022
1 parent 23925ed commit f723636
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 3 deletions.
30 changes: 30 additions & 0 deletions dist/cirrus-all.css
Original file line number Diff line number Diff line change
Expand Up @@ -14206,6 +14206,36 @@ ul .divider::after {
bottom: -100% !important;
}
}
.u-blur-none {
--cirrus-blur: blur(0);
filter: var(--cirrus-blur);
}

.u-blur-xs {
--cirrus-blur: blur(0.25rem);
filter: var(--cirrus-blur);
}

.u-blur-sm {
--cirrus-blur: blur(0.5rem);
filter: var(--cirrus-blur);
}

.u-blur-md {
--cirrus-blur: blur(1rem);
filter: var(--cirrus-blur);
}

.u-blur-lg {
--cirrus-blur: blur(1.5rem);
filter: var(--cirrus-blur);
}

.u-blur-xl {
--cirrus-blur: blur(3rem);
filter: var(--cirrus-blur);
}

.u-clear-left {
clear: left !important;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus-all.min.css

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions dist/cirrus-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -12625,6 +12625,36 @@ ul .divider::after {
bottom: -100% !important;
}

.u-blur-none {
--cirrus-blur: blur(0);
filter: var(--cirrus-blur);
}

.u-blur-xs {
--cirrus-blur: blur(0.25rem);
filter: var(--cirrus-blur);
}

.u-blur-sm {
--cirrus-blur: blur(0.5rem);
filter: var(--cirrus-blur);
}

.u-blur-md {
--cirrus-blur: blur(1rem);
filter: var(--cirrus-blur);
}

.u-blur-lg {
--cirrus-blur: blur(1.5rem);
filter: var(--cirrus-blur);
}

.u-blur-xl {
--cirrus-blur: blur(3rem);
filter: var(--cirrus-blur);
}

.u-clear-left {
clear: left !important;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus-core.min.css

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions dist/cirrus.css
Original file line number Diff line number Diff line change
Expand Up @@ -12626,6 +12626,36 @@ ul .divider::after {
bottom: -100% !important;
}

.u-blur-none {
--cirrus-blur: blur(0);
filter: var(--cirrus-blur);
}

.u-blur-xs {
--cirrus-blur: blur(0.25rem);
filter: var(--cirrus-blur);
}

.u-blur-sm {
--cirrus-blur: blur(0.5rem);
filter: var(--cirrus-blur);
}

.u-blur-md {
--cirrus-blur: blur(1rem);
filter: var(--cirrus-blur);
}

.u-blur-lg {
--cirrus-blur: blur(1.5rem);
filter: var(--cirrus-blur);
}

.u-blur-xl {
--cirrus-blur: blur(3rem);
filter: var(--cirrus-blur);
}

.u-clear-left {
clear: left !important;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cirrus.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/builds/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

// Utilities
@use "../utils/absolute";
@use "../utils/blur";
@use "../utils/clearfix";
@use "../utils/display";
@use "../utils/flex";
Expand Down
23 changes: 23 additions & 0 deletions src/internal/_config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ $default-config: (
flags.$MIN-WIDTH: false,
flags.$MAX-WIDTH: false,
flags.$GRID: true,
flags.$BLUR: false,
),
// Extend all existing styles here
extend:
Expand Down Expand Up @@ -112,6 +113,7 @@ $default-config: (
space-sizes: (),
tab-sizes: (),
absolute: (),
blur: (),
flex: (
properties: (),
),
Expand Down Expand Up @@ -611,6 +613,26 @@ $default-config: (
n50p: -50%,
n100p: -100%,
),
blurs: (
'none': (
--cirrus-blur: blur(0),
),
constants.$xs: (
--cirrus-blur: blur(0.25rem),
),
constants.$sm: (
--cirrus-blur: blur(0.5rem),
),
constants.$md: (
--cirrus-blur: blur(1rem),
),
constants.$lg: (
--cirrus-blur: blur(1.5rem),
),
constants.$xl: (
--cirrus-blur: blur(3rem),
),
),
flex: (
properties: (
flex-columns: 12,
Expand Down Expand Up @@ -842,6 +864,7 @@ $tag-font-sizes: functions.get-with-extend($all-config, tags, font-sizes);

// UTILS
$absolute: functions.get-with-extend($all-config, absolute);
$blurs: functions.get-with-extend($all-config, blurs);

$heights: functions.get-with-extend($all-config, heights);
$widths: functions.get-with-extend($all-config, widths);
Expand Down
1 change: 1 addition & 0 deletions src/internal/_flags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ $GAP: 'GAP';
$ROUND: 'ROUND';
$SHADOWS: 'SHADOWS';
$LETTER-SPACING: 'LETTER-SPACING';
$BLUR: 'BLUR';
17 changes: 17 additions & 0 deletions src/utils/blur.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Utility classes for shadows
@use '../internal' as *;

$generate-utility: should-generate-classes($BLUR);

@if $generate-utility {
@include generate-styles-with-viewports($generate-viewports: #{get-viewport-flag($BLUR)}) using ($viewport) {
$suffix: if($viewport != '', '-#{$viewport}', '');

@each $class, $property-map in $blurs {
.u-blur-#{$class}#{$suffix} {
@include explode-properties($property-map);
filter: var(--cirrus-blur);
}
}
}
}

0 comments on commit f723636

Please sign in to comment.