unigrid.css 0.3.0 → 0.3.2

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.
Files changed (44) hide show
  1. package/README.md +101 -101
  2. package/dist/dropdown.js +36 -36
  3. package/dist/scrollspy.js +57 -57
  4. package/dist/tabs.js +30 -30
  5. package/dist/unigrid.css +4608 -4501
  6. package/dist/unigrid.js +173 -124
  7. package/dist/unigrid.min.css +1 -1
  8. package/dist/unigrid.min.js +1 -1
  9. package/package.json +70 -41
  10. package/src/js/dropdown.js +49 -49
  11. package/src/js/index.js +20 -19
  12. package/src/js/modal.js +81 -0
  13. package/src/js/scrollspy.js +87 -87
  14. package/src/js/tabs.js +58 -58
  15. package/src/scss/_accordion.scss +123 -123
  16. package/src/scss/_broadside.scss +125 -125
  17. package/src/scss/_buttons.scss +241 -241
  18. package/src/scss/_card.scss +168 -168
  19. package/src/scss/_components.scss +140 -140
  20. package/src/scss/_container.scss +53 -53
  21. package/src/scss/_dropdown.scss +178 -178
  22. package/src/scss/_footer.scss +147 -147
  23. package/src/scss/_formats.scss +64 -64
  24. package/src/scss/_forms.scss +192 -192
  25. package/src/scss/_grid.scss +114 -114
  26. package/src/scss/_header.scss +169 -169
  27. package/src/scss/_hero.scss +262 -262
  28. package/src/scss/_mixins.scss +120 -120
  29. package/src/scss/_modal.scss +158 -0
  30. package/src/scss/_modules.scss +238 -238
  31. package/src/scss/_navbar.scss +341 -341
  32. package/src/scss/_pagination.scss +160 -160
  33. package/src/scss/_prose.scss +393 -393
  34. package/src/scss/_reset.scss +82 -82
  35. package/src/scss/_scrollspy.scss +62 -62
  36. package/src/scss/_section.scss +91 -91
  37. package/src/scss/_sidebar.scss +147 -147
  38. package/src/scss/_table.scss +122 -122
  39. package/src/scss/_tabs.scss +178 -178
  40. package/src/scss/_typography.scss +105 -105
  41. package/src/scss/_utilities.scss +79 -79
  42. package/src/scss/_variables.scss +183 -183
  43. package/src/scss/unigrid.scss +50 -49
  44. package/dist/index.js +0 -5
@@ -1,262 +1,262 @@
1
- // ==========================================================================
2
- // Unigrid CSS Framework — Hero (BEM)
3
- //
4
- // Full-width hero section for page introductions. Supports background
5
- // images, overlays, and flexible content positioning.
6
- //
7
- // Block: .ug-hero
8
- // Elements: __background, __overlay, __content, __title, __subtitle,
9
- // __lead, __actions
10
- // Modifiers: --full, --half, --third, --dark, --light, --center, --bottom
11
- // ==========================================================================
12
-
13
-
14
- @use "variables" as *;
15
- @use "mixins" as *;
16
-
17
- .ug-hero {
18
- position: relative;
19
- display: flex;
20
- flex-direction: column;
21
- justify-content: flex-end;
22
- width: 100%;
23
- min-height: round(down, 50vh, var(--ug-leading));
24
- padding: calc(var(--ug-leading) * 3) calc(var(--ug-leading) * 1.5);
25
- color: $ug-white;
26
- overflow: hidden;
27
-
28
- // -- Background image --
29
- &__background {
30
- position: absolute;
31
- inset: 0;
32
- z-index: 0;
33
-
34
- img,
35
- video {
36
- width: 100%;
37
- height: 100%;
38
- object-fit: cover;
39
- }
40
- }
41
-
42
- // -- Overlay (darkens background for readability) --
43
- &__overlay {
44
- position: absolute;
45
- inset: 0;
46
- z-index: 1;
47
- background: linear-gradient(
48
- to top,
49
- rgba(0, 0, 0, 0.7) 0%,
50
- rgba(0, 0, 0, 0.2) 60%,
51
- transparent 100%
52
- );
53
- }
54
-
55
- // -- Content wrapper --
56
- &__content {
57
- position: relative;
58
- z-index: 2;
59
- max-width: $ug-container-max-width;
60
- width: 100%;
61
- }
62
-
63
- // -- Title --
64
- &__title {
65
- @include ug-rhythm-font-size(2.5);
66
- @include ug-rhythm-line-height(2);
67
- @include ug-font-weight("black");
68
- letter-spacing: -0.02em;
69
- @include ug-rhythm-margin-bottom(1);
70
- margin-top: 0;
71
-
72
- @include ug-breakpoint-down("md") {
73
- @include ug-rhythm-font-size(2);
74
- }
75
- }
76
-
77
- // -- Subtitle --
78
- &__subtitle {
79
- @include ug-font-size("lg");
80
- @include ug-font-weight("light");
81
- @include ug-rhythm-line-height(1);
82
- opacity: 0.85;
83
- margin-bottom: 0;
84
- margin-top: 0;
85
- }
86
-
87
- // -- Lead text --
88
- &__lead {
89
- @include ug-font-size("base");
90
- @include ug-font-weight("regular");
91
- @include ug-rhythm-line-height(1);
92
- max-width: $ug-prose-max-width;
93
- opacity: 0.8;
94
- @include ug-rhythm-margin-bottom(1);
95
- margin-top: 0;
96
- }
97
-
98
- // -- Action buttons area --
99
- &__actions {
100
- display: flex;
101
- gap: var(--ug-leading);
102
- flex-wrap: wrap;
103
- @include ug-rhythm-margin-top(1);
104
- }
105
-
106
- // ==============================
107
- // Height Modifiers
108
- // ==============================
109
-
110
- &--full {
111
- min-height: round(down, 100vh, var(--ug-leading));
112
- }
113
-
114
- &--half {
115
- min-height: round(down, 50vh, var(--ug-leading));
116
- }
117
-
118
- &--third {
119
- min-height: round(down, 33vh, var(--ug-leading));
120
- }
121
-
122
- &--auto {
123
- min-height: 0;
124
- }
125
-
126
- // ==============================
127
- // Content Alignment
128
- // ==============================
129
-
130
- &--center {
131
- justify-content: center;
132
- align-items: center;
133
- text-align: center;
134
-
135
- .ug-hero__content {
136
- display: flex;
137
- flex-direction: column;
138
- align-items: center;
139
- }
140
-
141
- .ug-hero__lead {
142
- margin-left: auto;
143
- margin-right: auto;
144
- }
145
-
146
- .ug-hero__actions {
147
- justify-content: center;
148
- }
149
- }
150
-
151
- &--bottom {
152
- justify-content: flex-end;
153
- }
154
-
155
- &--top {
156
- justify-content: flex-start;
157
- }
158
-
159
- // ==============================
160
- // Color Variants
161
- // ==============================
162
-
163
- // Dark (default) — white text on dark background
164
- &--dark {
165
- background-color: $ug-black;
166
- color: $ug-white;
167
- }
168
-
169
- // Light — dark text on light background
170
- &--light {
171
- background-color: $ug-warm-gray;
172
- color: $ug-black;
173
-
174
- .ug-hero__overlay {
175
- background: linear-gradient(
176
- to top,
177
- rgba(255, 255, 255, 0.8) 0%,
178
- rgba(255, 255, 255, 0.2) 60%,
179
- transparent 100%
180
- );
181
- }
182
- }
183
-
184
- // NPS colors
185
- &--brown {
186
- background-color: $ug-brown;
187
- }
188
-
189
- &--green {
190
- background-color: $ug-green;
191
- }
192
-
193
- &--blue {
194
- background-color: $ug-blue;
195
- }
196
-
197
- &--red {
198
- background-color: $ug-red;
199
- }
200
-
201
- // ==============================
202
- // DIN Proportions
203
- // ==============================
204
-
205
- &--din {
206
- @include ug-ratio-din(true);
207
- min-height: 0;
208
- // The DIN aspect ratio height is not a leading multiple.
209
- // Round margin-bottom to snap the next element back onto the grid.
210
- // Uses CSS round() (supported in modern browsers).
211
- margin-bottom: calc(var(--ug-leading) - mod(100vw / #{$ug-ratio}, var(--ug-leading)));
212
- }
213
-
214
- // ==============================
215
- // Responsive
216
- // ==============================
217
-
218
- @include ug-breakpoint-down("md") {
219
- padding: calc(var(--ug-leading) * 2) var(--ug-leading);
220
- min-height: round(down, 40vh, var(--ug-leading));
221
-
222
- &--full {
223
- min-height: round(down, 100vh, var(--ug-leading));
224
- }
225
- }
226
- }
227
-
228
- // ---- Hero Button ----
229
- // Simple button for use within .ug-hero__actions
230
-
231
- .ug-hero__btn {
232
- display: inline-flex;
233
- align-items: center;
234
- justify-content: center;
235
- gap: calc(var(--ug-leading) * 0.5);
236
- height: calc(var(--ug-leading) * 1.5);
237
- padding: 0 var(--ug-leading);
238
- @include ug-font-size("sm");
239
- @include ug-font-weight("bold");
240
- text-decoration: none;
241
- border: 2px solid currentColor;
242
- background: transparent;
243
- color: inherit;
244
- cursor: pointer;
245
- transition: background-color 0.15s, color 0.15s;
246
-
247
- &:hover {
248
- background-color: $ug-white;
249
- color: $ug-black;
250
- }
251
-
252
- &--filled {
253
- background-color: $ug-white;
254
- color: $ug-black;
255
- border-color: $ug-white;
256
-
257
- &:hover {
258
- background-color: transparent;
259
- color: $ug-white;
260
- }
261
- }
262
- }
1
+ // ==========================================================================
2
+ // Unigrid CSS Framework — Hero (BEM)
3
+ //
4
+ // Full-width hero section for page introductions. Supports background
5
+ // images, overlays, and flexible content positioning.
6
+ //
7
+ // Block: .ug-hero
8
+ // Elements: __background, __overlay, __content, __title, __subtitle,
9
+ // __lead, __actions
10
+ // Modifiers: --full, --half, --third, --dark, --light, --center, --bottom
11
+ // ==========================================================================
12
+
13
+
14
+ @use "variables" as *;
15
+ @use "mixins" as *;
16
+
17
+ .ug-hero {
18
+ position: relative;
19
+ display: flex;
20
+ flex-direction: column;
21
+ justify-content: flex-end;
22
+ width: 100%;
23
+ min-height: round(down, 50vh, var(--ug-leading));
24
+ padding: calc(var(--ug-leading) * 3) calc(var(--ug-leading) * 1.5);
25
+ color: $ug-white;
26
+ overflow: hidden;
27
+
28
+ // -- Background image --
29
+ &__background {
30
+ position: absolute;
31
+ inset: 0;
32
+ z-index: 0;
33
+
34
+ img,
35
+ video {
36
+ width: 100%;
37
+ height: 100%;
38
+ object-fit: cover;
39
+ }
40
+ }
41
+
42
+ // -- Overlay (darkens background for readability) --
43
+ &__overlay {
44
+ position: absolute;
45
+ inset: 0;
46
+ z-index: 1;
47
+ background: linear-gradient(
48
+ to top,
49
+ rgba(0, 0, 0, 0.7) 0%,
50
+ rgba(0, 0, 0, 0.2) 60%,
51
+ transparent 100%
52
+ );
53
+ }
54
+
55
+ // -- Content wrapper --
56
+ &__content {
57
+ position: relative;
58
+ z-index: 2;
59
+ max-width: $ug-container-max-width;
60
+ width: 100%;
61
+ }
62
+
63
+ // -- Title --
64
+ &__title {
65
+ @include ug-rhythm-font-size(2.5);
66
+ @include ug-rhythm-line-height(2);
67
+ @include ug-font-weight("black");
68
+ letter-spacing: -0.02em;
69
+ @include ug-rhythm-margin-bottom(1);
70
+ margin-top: 0;
71
+
72
+ @include ug-breakpoint-down("md") {
73
+ @include ug-rhythm-font-size(2);
74
+ }
75
+ }
76
+
77
+ // -- Subtitle --
78
+ &__subtitle {
79
+ @include ug-font-size("lg");
80
+ @include ug-font-weight("light");
81
+ @include ug-rhythm-line-height(1);
82
+ opacity: 0.85;
83
+ margin-bottom: 0;
84
+ margin-top: 0;
85
+ }
86
+
87
+ // -- Lead text --
88
+ &__lead {
89
+ @include ug-font-size("base");
90
+ @include ug-font-weight("regular");
91
+ @include ug-rhythm-line-height(1);
92
+ max-width: $ug-prose-max-width;
93
+ opacity: 0.8;
94
+ @include ug-rhythm-margin-bottom(1);
95
+ margin-top: 0;
96
+ }
97
+
98
+ // -- Action buttons area --
99
+ &__actions {
100
+ display: flex;
101
+ gap: var(--ug-leading);
102
+ flex-wrap: wrap;
103
+ @include ug-rhythm-margin-top(1);
104
+ }
105
+
106
+ // ==============================
107
+ // Height Modifiers
108
+ // ==============================
109
+
110
+ &--full {
111
+ min-height: round(down, 100vh, var(--ug-leading));
112
+ }
113
+
114
+ &--half {
115
+ min-height: round(down, 50vh, var(--ug-leading));
116
+ }
117
+
118
+ &--third {
119
+ min-height: round(down, 33vh, var(--ug-leading));
120
+ }
121
+
122
+ &--auto {
123
+ min-height: 0;
124
+ }
125
+
126
+ // ==============================
127
+ // Content Alignment
128
+ // ==============================
129
+
130
+ &--center {
131
+ justify-content: center;
132
+ align-items: center;
133
+ text-align: center;
134
+
135
+ .ug-hero__content {
136
+ display: flex;
137
+ flex-direction: column;
138
+ align-items: center;
139
+ }
140
+
141
+ .ug-hero__lead {
142
+ margin-left: auto;
143
+ margin-right: auto;
144
+ }
145
+
146
+ .ug-hero__actions {
147
+ justify-content: center;
148
+ }
149
+ }
150
+
151
+ &--bottom {
152
+ justify-content: flex-end;
153
+ }
154
+
155
+ &--top {
156
+ justify-content: flex-start;
157
+ }
158
+
159
+ // ==============================
160
+ // Color Variants
161
+ // ==============================
162
+
163
+ // Dark (default) — white text on dark background
164
+ &--dark {
165
+ background-color: $ug-black;
166
+ color: $ug-white;
167
+ }
168
+
169
+ // Light — dark text on light background
170
+ &--light {
171
+ background-color: $ug-warm-gray;
172
+ color: $ug-black;
173
+
174
+ .ug-hero__overlay {
175
+ background: linear-gradient(
176
+ to top,
177
+ rgba(255, 255, 255, 0.8) 0%,
178
+ rgba(255, 255, 255, 0.2) 60%,
179
+ transparent 100%
180
+ );
181
+ }
182
+ }
183
+
184
+ // NPS colors
185
+ &--brown {
186
+ background-color: $ug-brown;
187
+ }
188
+
189
+ &--green {
190
+ background-color: $ug-green;
191
+ }
192
+
193
+ &--blue {
194
+ background-color: $ug-blue;
195
+ }
196
+
197
+ &--red {
198
+ background-color: $ug-red;
199
+ }
200
+
201
+ // ==============================
202
+ // DIN Proportions
203
+ // ==============================
204
+
205
+ &--din {
206
+ @include ug-ratio-din(true);
207
+ min-height: 0;
208
+ // The DIN aspect ratio height is not a leading multiple.
209
+ // Round margin-bottom to snap the next element back onto the grid.
210
+ // Uses CSS round() (supported in modern browsers).
211
+ margin-bottom: calc(var(--ug-leading) - mod(100vw / #{$ug-ratio}, var(--ug-leading)));
212
+ }
213
+
214
+ // ==============================
215
+ // Responsive
216
+ // ==============================
217
+
218
+ @include ug-breakpoint-down("md") {
219
+ padding: calc(var(--ug-leading) * 2) var(--ug-leading);
220
+ min-height: round(down, 40vh, var(--ug-leading));
221
+
222
+ &--full {
223
+ min-height: round(down, 100vh, var(--ug-leading));
224
+ }
225
+ }
226
+ }
227
+
228
+ // ---- Hero Button ----
229
+ // Simple button for use within .ug-hero__actions
230
+
231
+ .ug-hero__btn {
232
+ display: inline-flex;
233
+ align-items: center;
234
+ justify-content: center;
235
+ gap: calc(var(--ug-leading) * 0.5);
236
+ height: calc(var(--ug-leading) * 1.5);
237
+ padding: 0 var(--ug-leading);
238
+ @include ug-font-size("sm");
239
+ @include ug-font-weight("bold");
240
+ text-decoration: none;
241
+ border: 2px solid currentColor;
242
+ background: transparent;
243
+ color: inherit;
244
+ cursor: pointer;
245
+ transition: background-color 0.15s, color 0.15s;
246
+
247
+ &:hover {
248
+ background-color: $ug-white;
249
+ color: $ug-black;
250
+ }
251
+
252
+ &--filled {
253
+ background-color: $ug-white;
254
+ color: $ug-black;
255
+ border-color: $ug-white;
256
+
257
+ &:hover {
258
+ background-color: transparent;
259
+ color: $ug-white;
260
+ }
261
+ }
262
+ }