ply-css 1.3.3 → 1.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ply-css",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "ply — A ratio-based, AI-ready CSS framework with dark mode, accessibility, and a small footprint",
5
5
  "main": "dist/css/ply.css",
6
6
  "style": "dist/css/ply.min.css",
package/ply-classes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.3",
2
+ "version": "1.4.0",
3
3
  "framework": "ply",
4
4
  "totalClasses": 457,
5
5
  "uniqueClasses": 457,
@@ -1,3 +1,4 @@
1
+ @use "sass:math";
1
2
  @use "media-queries";
2
3
  @use "variables";
3
4
 
@@ -23,8 +24,11 @@ $container-breakpoints: (
23
24
  @container (max-width: #{$bp-value}) {
24
25
  @each $name, $value in variables.$unit-scale {
25
26
  .container-#{$bp-name}-unit-#{$name} {
26
- max-width: $value;
27
- flex-basis: $value;
27
+ @if $name == 100 {
28
+ flex-basis: 100%;
29
+ } @else {
30
+ flex-basis: calc(#{$value} - var(--units-gap, 1rem) * #{1 - math.div($name, 100)});
31
+ }
28
32
  }
29
33
  }
30
34
  .container-#{$bp-name}-unit-auto {
@@ -23,7 +23,8 @@
23
23
  display: flex;
24
24
  flex: 0 1 auto;
25
25
  flex-flow: row wrap;
26
- margin: 0 (-(variables.$grid-gutter-width)) variables.$base-line;
26
+ gap: var(--units-gap, #{variables.$grid-gutter-width * 2});
27
+ margin: 0 0 variables.$base-line;
27
28
 
28
29
  &.reverse-direction,
29
30
  &.right-to-left {
@@ -31,11 +32,8 @@
31
32
  }
32
33
 
33
34
  &.split {
34
- margin: 0 0 variables.$base-line;
35
-
36
- [class*='unit-'] {
37
- padding: 0;
38
- }
35
+ --units-gap: 0px;
36
+ gap: 0;
39
37
  }
40
38
 
41
39
  &.centered-content {
@@ -74,8 +72,6 @@
74
72
  [class*='unit-'] {
75
73
  box-sizing: border-box;
76
74
 
77
- padding: 0 variables.$grid-gutter-width;
78
-
79
75
  &.fill-height {
80
76
  display: flex;
81
77
  }
@@ -89,8 +85,11 @@
89
85
 
90
86
  @each $name, $value in variables.$unit-scale {
91
87
  .unit-#{$name} {
92
- flex-basis: $value;
93
- max-width: $value;
88
+ @if $name == 100 {
89
+ flex-basis: 100%;
90
+ } @else {
91
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
92
+ }
94
93
  }
95
94
  }
96
95
 
@@ -102,8 +101,11 @@
102
101
 
103
102
  @each $name, $value in variables.$unit-scale {
104
103
  .forever-unit-#{$name} {
105
- flex-basis: $value;
106
- max-width: $value;
104
+ @if $name == 100 {
105
+ flex-basis: 100%;
106
+ } @else {
107
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
108
+ }
107
109
  }
108
110
  }
109
111
 
@@ -112,8 +114,7 @@
112
114
  @each $name, $value in variables.$width-scale {
113
115
  @if $name != 100 {
114
116
  .large-screen-unit-#{$name} {
115
- max-width: $value;
116
- flex-basis: $value;
117
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
117
118
  }
118
119
  }
119
120
  }
@@ -124,8 +125,7 @@
124
125
  @each $name, $value in variables.$width-scale {
125
126
  @if $name != 100 {
126
127
  .x-large-screen-unit-#{$name} {
127
- max-width: $value;
128
- flex-basis: $value;
128
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
129
129
  }
130
130
  }
131
131
  }
@@ -134,9 +134,14 @@
134
134
  // Small desktop (max-width)
135
135
  @media (max-width: media-queries.$breakpoint-small-desktop) {
136
136
  @each $name, $value in variables.$width-scale {
137
- .small-desktop-unit-#{$name} {
138
- max-width: $value;
139
- flex-basis: $value;
137
+ @if $name == 100 {
138
+ .small-desktop-unit-#{$name} {
139
+ flex-basis: 100%;
140
+ }
141
+ } @else {
142
+ .small-desktop-unit-#{$name} {
143
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
144
+ }
140
145
  }
141
146
  }
142
147
  }
@@ -161,13 +166,17 @@
161
166
  .unit-20,
162
167
  .unit-10 {
163
168
  flex-basis: 100%;
164
- max-width: 100%;
165
169
  }
166
170
 
167
171
  @each $name, $value in variables.$width-scale {
168
- .tablet-unit-#{$name} {
169
- max-width: $value;
170
- flex-basis: $value;
172
+ @if $name == 100 {
173
+ .tablet-unit-#{$name} {
174
+ flex-basis: 100%;
175
+ }
176
+ } @else {
177
+ .tablet-unit-#{$name} {
178
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
179
+ }
171
180
  }
172
181
  }
173
182
  }
@@ -175,9 +184,14 @@
175
184
  // Large phone (max-width)
176
185
  @media (max-width: media-queries.$breakpoint-large-phone) {
177
186
  @each $name, $value in variables.$width-scale {
178
- .large-phone-unit-#{$name} {
179
- max-width: $value;
180
- flex-basis: $value;
187
+ @if $name == 100 {
188
+ .large-phone-unit-#{$name} {
189
+ flex-basis: 100%;
190
+ }
191
+ } @else {
192
+ .large-phone-unit-#{$name} {
193
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
194
+ }
181
195
  }
182
196
  }
183
197
  }
@@ -185,9 +199,14 @@
185
199
  // Phone (max-width)
186
200
  @media (max-width: media-queries.$breakpoint-phone) {
187
201
  @each $name, $value in variables.$width-scale {
188
- .phone-unit-#{$name} {
189
- max-width: $value;
190
- flex-basis: $value;
202
+ @if $name == 100 {
203
+ .phone-unit-#{$name} {
204
+ flex-basis: 100%;
205
+ }
206
+ } @else {
207
+ .phone-unit-#{$name} {
208
+ flex-basis: calc(#{$value} - var(--units-gap, #{variables.$grid-gutter-width * 2}) * #{1 - math.div($name, 100)});
209
+ }
191
210
  }
192
211
  }
193
212
  }
@@ -330,13 +330,36 @@ $width-breakpoints: (
330
330
  .bg-green { background-color: var(--ply-bg-green); }
331
331
  .bg-yellow { background-color: var(--ply-bg-yellow); }
332
332
 
333
- // Gap utilities
334
- .gap-xs { gap: var(--ply-space-xs, 0.25rem); }
335
- .gap-sm { gap: var(--ply-space-sm, 0.5rem); }
336
- .gap { gap: var(--ply-space-md, 0.75rem); }
337
- .gap-lg { gap: var(--ply-space-lg, 1.5rem); }
338
- .gap-xl { gap: var(--ply-space-xl, 2rem); }
339
- .gap-xxl { gap: var(--ply-space-xxl, 3rem); }
333
+ // Gap utilities — also set --units-gap so unit calc() sizing adjusts automatically
334
+ .gap-xs {
335
+ --units-gap: var(--ply-space-xs, 0.25rem);
336
+ gap: var(--units-gap);
337
+ }
338
+
339
+ .gap-sm {
340
+ --units-gap: var(--ply-space-sm, 0.5rem);
341
+ gap: var(--units-gap);
342
+ }
343
+
344
+ .gap {
345
+ --units-gap: var(--ply-space-md, 0.75rem);
346
+ gap: var(--units-gap);
347
+ }
348
+
349
+ .gap-lg {
350
+ --units-gap: var(--ply-space-lg, 1.5rem);
351
+ gap: var(--units-gap);
352
+ }
353
+
354
+ .gap-xl {
355
+ --units-gap: var(--ply-space-xl, 2rem);
356
+ gap: var(--units-gap);
357
+ }
358
+
359
+ .gap-xxl {
360
+ --units-gap: var(--ply-space-xxl, 3rem);
361
+ gap: var(--units-gap);
362
+ }
340
363
 
341
364
  // Link reset — suppress link styling inside a container
342
365
  .no-link-style {