@oardi/css-utils 0.127.0 → 0.128.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@oardi/css-utils",
3
- "version": "0.127.0",
3
+ "version": "0.128.0",
4
4
  "breakpoints": { "sm": "576px", "md": "768px", "lg": "992px", "xl": "1200px", "xxl": "1400px" },
5
5
  "utilities": {
6
6
  "Display": {
@@ -367,7 +367,24 @@
367
367
  "950"
368
368
  ]
369
369
  },
370
- { "patterns": ["bg-opacity-{value}"], "values": ["10", "25", "50", "75"] },
370
+ {
371
+ "patterns": ["bg-opacity-{value}"],
372
+ "values": [
373
+ "0",
374
+ "10",
375
+ "100",
376
+ "20",
377
+ "25",
378
+ "30",
379
+ "40",
380
+ "50",
381
+ "60",
382
+ "70",
383
+ "75",
384
+ "80",
385
+ "90"
386
+ ]
387
+ },
371
388
  {
372
389
  "patterns": ["bg-{value}"],
373
390
  "values": [
@@ -3,7 +3,7 @@
3
3
  > Generated automatically. Do not edit manually.
4
4
 
5
5
  - Package: `@oardi/css-utils`
6
- - Version: `0.127.0`
6
+ - Version: `0.128.0`
7
7
  - Source: public SCSS entry point and utility configuration
8
8
 
9
9
  ## Usage guidance
@@ -268,7 +268,7 @@ Values: `100` | `150` | `200` | `250` | `300` | `350` | `400` | `450` | `50` | `
268
268
 
269
269
  - `bg-gray-{value}`
270
270
 
271
- Values: `10` | `25` | `50` | `75`
271
+ Values: `0` | `10` | `100` | `20` | `25` | `30` | `40` | `50` | `60` | `70` | `75` | `80` | `90`
272
272
 
273
273
  - `bg-opacity-{value}`
274
274
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oardi/css-utils",
3
- "version": "0.127.0",
3
+ "version": "0.128.0",
4
4
  "author": "Ardian Shala",
5
5
  "homepage": "https://css-utils.oardi.com",
6
6
  "description": "Powerful set of semantic css classes with support for breakpoints, directions and spacings",
@@ -1,5 +1,8 @@
1
1
  @use 'sass:color';
2
+ @use 'sass:list';
2
3
  @use 'sass:map';
4
+ @use 'sass:math';
5
+ @use 'sass:string';
3
6
  @use './layers.scss';
4
7
  @use './display.scss';
5
8
  @use './theme.scss' as theme;
@@ -40,6 +43,31 @@ $-inset-properties: (
40
43
 
41
44
  $-overflow-wrap-values: normal, break-word, anywhere;
42
45
 
46
+ $-background-opacities: (
47
+ 0: 0,
48
+ 10: 0.1,
49
+ 20: 0.2,
50
+ 25: 0.25,
51
+ 30: 0.3,
52
+ 40: 0.4,
53
+ 50: 0.5,
54
+ 60: 0.6,
55
+ 70: 0.7,
56
+ 75: 0.75,
57
+ 80: 0.8,
58
+ 90: 0.9,
59
+ 100: 1,
60
+ );
61
+
62
+ $-background-opacity-selectors: ();
63
+ @each $percentage, $opacity in $-background-opacities {
64
+ $-background-opacity-selectors: list.append(
65
+ $-background-opacity-selectors,
66
+ string.unquote('.bg-opacity-#{$percentage}'),
67
+ $separator: comma
68
+ );
69
+ }
70
+
43
71
  // Guard the dynamic value: a var() declaration can otherwise become invalid only
44
72
  // at computed-value time, when an earlier color declaration cannot rescue it.
45
73
  @mixin -background-foreground($background, $fallback) {
@@ -63,7 +91,7 @@ $-overflow-wrap-values: normal, break-word, anywhere;
63
91
  @supports (color: contrast-color(white)) {
64
92
  background-color: rgb(from #{$background} r g b / var(--bg-opacity));
65
93
 
66
- &:where(.bg-opacity-10, .bg-opacity-25, .bg-opacity-50, .bg-opacity-75) {
94
+ &:where(#{$-background-opacity-selectors}) {
67
95
  --bg-opacity-backdrop: inherit;
68
96
  --bg-opacity-composite: color-mix(
69
97
  in srgb,
@@ -76,8 +104,7 @@ $-overflow-wrap-values: normal, break-word, anywhere;
76
104
  fill: currentcolor;
77
105
  }
78
106
 
79
- :where(.bg-opacity-10, .bg-opacity-25, .bg-opacity-50, .bg-opacity-75)
80
- > &:where(.bg-opacity-10, .bg-opacity-25, .bg-opacity-50, .bg-opacity-75) {
107
+ :where(#{$-background-opacity-selectors}) > &:where(#{$-background-opacity-selectors}) {
81
108
  --bg-opacity-rendered: inherit;
82
109
  --bg-opacity-composite: color-mix(
83
110
  in srgb,
@@ -163,24 +190,11 @@ $-overflow-wrap-values: normal, break-word, anywhere;
163
190
  @include -background-utility(var(--bg-active), var(--text-color));
164
191
  }
165
192
 
166
- .bg-opacity-10 {
167
- --bg-opacity: 0.1;
168
- --bg-opacity-percentage: 10%;
169
- }
170
-
171
- .bg-opacity-25 {
172
- --bg-opacity: 0.25;
173
- --bg-opacity-percentage: 25%;
174
- }
175
-
176
- .bg-opacity-50 {
177
- --bg-opacity: 0.5;
178
- --bg-opacity-percentage: 50%;
179
- }
180
-
181
- .bg-opacity-75 {
182
- --bg-opacity: 0.75;
183
- --bg-opacity-percentage: 75%;
193
+ @each $percentage, $opacity in $-background-opacities {
194
+ .bg-opacity-#{$percentage} {
195
+ --bg-opacity: #{$opacity};
196
+ --bg-opacity-percentage: #{math.percentage($opacity)};
197
+ }
184
198
  }
185
199
 
186
200
  .img-responsive {