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.
- package/README.md +101 -101
- package/dist/dropdown.js +36 -36
- package/dist/scrollspy.js +57 -57
- package/dist/tabs.js +30 -30
- package/dist/unigrid.css +4608 -4501
- package/dist/unigrid.js +173 -124
- package/dist/unigrid.min.css +1 -1
- package/dist/unigrid.min.js +1 -1
- package/package.json +70 -41
- package/src/js/dropdown.js +49 -49
- package/src/js/index.js +20 -19
- package/src/js/modal.js +81 -0
- package/src/js/scrollspy.js +87 -87
- package/src/js/tabs.js +58 -58
- package/src/scss/_accordion.scss +123 -123
- package/src/scss/_broadside.scss +125 -125
- package/src/scss/_buttons.scss +241 -241
- package/src/scss/_card.scss +168 -168
- package/src/scss/_components.scss +140 -140
- package/src/scss/_container.scss +53 -53
- package/src/scss/_dropdown.scss +178 -178
- package/src/scss/_footer.scss +147 -147
- package/src/scss/_formats.scss +64 -64
- package/src/scss/_forms.scss +192 -192
- package/src/scss/_grid.scss +114 -114
- package/src/scss/_header.scss +169 -169
- package/src/scss/_hero.scss +262 -262
- package/src/scss/_mixins.scss +120 -120
- package/src/scss/_modal.scss +158 -0
- package/src/scss/_modules.scss +238 -238
- package/src/scss/_navbar.scss +341 -341
- package/src/scss/_pagination.scss +160 -160
- package/src/scss/_prose.scss +393 -393
- package/src/scss/_reset.scss +82 -82
- package/src/scss/_scrollspy.scss +62 -62
- package/src/scss/_section.scss +91 -91
- package/src/scss/_sidebar.scss +147 -147
- package/src/scss/_table.scss +122 -122
- package/src/scss/_tabs.scss +178 -178
- package/src/scss/_typography.scss +105 -105
- package/src/scss/_utilities.scss +79 -79
- package/src/scss/_variables.scss +183 -183
- package/src/scss/unigrid.scss +50 -49
- package/dist/index.js +0 -5
package/src/scss/_mixins.scss
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
// ==========================================================================
|
|
2
|
-
// Unigrid CSS Framework — Mixins
|
|
3
|
-
// ==========================================================================
|
|
4
|
-
|
|
5
|
-
@use "sass:map";
|
|
6
|
-
@use "sass:math";
|
|
7
|
-
@use "variables" as *;
|
|
8
|
-
|
|
9
|
-
// ---- Responsive Breakpoint ----
|
|
10
|
-
// Usage: @include ug-breakpoint("md") { ... }
|
|
11
|
-
@mixin ug-breakpoint($name) {
|
|
12
|
-
@if map.has-key($ug-breakpoints, $name) {
|
|
13
|
-
@media (min-width: map.get($ug-breakpoints, $name)) {
|
|
14
|
-
@content;
|
|
15
|
-
}
|
|
16
|
-
} @else {
|
|
17
|
-
@warn "Breakpoint '#{$name}' not found in $ug-breakpoints.";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// ---- Max-width Breakpoint ----
|
|
22
|
-
// Usage: @include ug-breakpoint-down("md") { ... }
|
|
23
|
-
@mixin ug-breakpoint-down($name) {
|
|
24
|
-
@if map.has-key($ug-breakpoints, $name) {
|
|
25
|
-
@media (max-width: map.get($ug-breakpoints, $name) - 1px) {
|
|
26
|
-
@content;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ---- Font Size Helper ----
|
|
32
|
-
@mixin ug-font-size($size) {
|
|
33
|
-
@if map.has-key($ug-font-sizes, $size) {
|
|
34
|
-
font-size: map.get($ug-font-sizes, $size);
|
|
35
|
-
} @else {
|
|
36
|
-
font-size: $size;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ---- Font Weight Helper ----
|
|
41
|
-
@mixin ug-font-weight($weight) {
|
|
42
|
-
@if map.has-key($ug-font-weights, $weight) {
|
|
43
|
-
font-weight: map.get($ug-font-weights, $weight);
|
|
44
|
-
} @else {
|
|
45
|
-
font-weight: $weight;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// ---- Spacing Helper ----
|
|
50
|
-
@function ug-space($n) {
|
|
51
|
-
@if map.has-key($ug-spaces, $n) {
|
|
52
|
-
@return map.get($ug-spaces, $n);
|
|
53
|
-
}
|
|
54
|
-
@return $n;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ---- DIN Aspect Ratio ----
|
|
58
|
-
@mixin ug-ratio-din($landscape: false) {
|
|
59
|
-
@if $landscape {
|
|
60
|
-
aspect-ratio: #{$ug-ratio} #{"/"} 1;
|
|
61
|
-
} @else {
|
|
62
|
-
aspect-ratio: 1 #{"/"} #{$ug-ratio};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// ---- Truncate Text ----
|
|
67
|
-
@mixin ug-truncate {
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
text-overflow: ellipsis;
|
|
70
|
-
white-space: nowrap;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ---- Visually Hidden (accessible) ----
|
|
74
|
-
@mixin ug-sr-only {
|
|
75
|
-
position: absolute;
|
|
76
|
-
width: 1px;
|
|
77
|
-
height: 1px;
|
|
78
|
-
padding: 0;
|
|
79
|
-
margin: -1px;
|
|
80
|
-
overflow: hidden;
|
|
81
|
-
clip: rect(0, 0, 0, 0);
|
|
82
|
-
white-space: nowrap;
|
|
83
|
-
border: 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ==========================================================================
|
|
87
|
-
// Vertical Rhythm Mixins (from Gutenberg)
|
|
88
|
-
// All vertical spacing uses var(--ug-leading) which adapts at the
|
|
89
|
-
// desktop breakpoint (26px mobile → 31px desktop).
|
|
90
|
-
// ==========================================================================
|
|
91
|
-
|
|
92
|
-
// ---- Rhythm Font Size ----
|
|
93
|
-
@mixin ug-rhythm-font-size($number) {
|
|
94
|
-
font-size: #{$number}rem;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// ---- Rhythm Line Height ----
|
|
98
|
-
@mixin ug-rhythm-line-height($number) {
|
|
99
|
-
line-height: calc(var(--ug-leading) * #{$number});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// ---- Rhythm Margin ----
|
|
103
|
-
@mixin ug-rhythm-margin-top($number) {
|
|
104
|
-
margin-top: calc(var(--ug-leading) * #{$number});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@mixin ug-rhythm-margin-bottom($number) {
|
|
108
|
-
margin-bottom: calc(var(--ug-leading) * #{$number});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// ---- Rhythm Padding ----
|
|
112
|
-
@mixin ug-rhythm-padding($top, $right, $bottom: null, $left: null) {
|
|
113
|
-
@if $bottom == null {
|
|
114
|
-
padding: calc(var(--ug-leading) * #{$top}) calc(var(--ug-leading) * #{$right});
|
|
115
|
-
} @else if $left == null {
|
|
116
|
-
padding: calc(var(--ug-leading) * #{$top}) calc(var(--ug-leading) * #{$right}) calc(var(--ug-leading) * #{$bottom});
|
|
117
|
-
} @else {
|
|
118
|
-
padding: calc(var(--ug-leading) * #{$top}) calc(var(--ug-leading) * #{$right}) calc(var(--ug-leading) * #{$bottom}) calc(var(--ug-leading) * #{$left});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Unigrid CSS Framework — Mixins
|
|
3
|
+
// ==========================================================================
|
|
4
|
+
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
@use "sass:math";
|
|
7
|
+
@use "variables" as *;
|
|
8
|
+
|
|
9
|
+
// ---- Responsive Breakpoint ----
|
|
10
|
+
// Usage: @include ug-breakpoint("md") { ... }
|
|
11
|
+
@mixin ug-breakpoint($name) {
|
|
12
|
+
@if map.has-key($ug-breakpoints, $name) {
|
|
13
|
+
@media (min-width: map.get($ug-breakpoints, $name)) {
|
|
14
|
+
@content;
|
|
15
|
+
}
|
|
16
|
+
} @else {
|
|
17
|
+
@warn "Breakpoint '#{$name}' not found in $ug-breakpoints.";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ---- Max-width Breakpoint ----
|
|
22
|
+
// Usage: @include ug-breakpoint-down("md") { ... }
|
|
23
|
+
@mixin ug-breakpoint-down($name) {
|
|
24
|
+
@if map.has-key($ug-breakpoints, $name) {
|
|
25
|
+
@media (max-width: map.get($ug-breakpoints, $name) - 1px) {
|
|
26
|
+
@content;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ---- Font Size Helper ----
|
|
32
|
+
@mixin ug-font-size($size) {
|
|
33
|
+
@if map.has-key($ug-font-sizes, $size) {
|
|
34
|
+
font-size: map.get($ug-font-sizes, $size);
|
|
35
|
+
} @else {
|
|
36
|
+
font-size: $size;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ---- Font Weight Helper ----
|
|
41
|
+
@mixin ug-font-weight($weight) {
|
|
42
|
+
@if map.has-key($ug-font-weights, $weight) {
|
|
43
|
+
font-weight: map.get($ug-font-weights, $weight);
|
|
44
|
+
} @else {
|
|
45
|
+
font-weight: $weight;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ---- Spacing Helper ----
|
|
50
|
+
@function ug-space($n) {
|
|
51
|
+
@if map.has-key($ug-spaces, $n) {
|
|
52
|
+
@return map.get($ug-spaces, $n);
|
|
53
|
+
}
|
|
54
|
+
@return $n;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ---- DIN Aspect Ratio ----
|
|
58
|
+
@mixin ug-ratio-din($landscape: false) {
|
|
59
|
+
@if $landscape {
|
|
60
|
+
aspect-ratio: #{$ug-ratio} #{"/"} 1;
|
|
61
|
+
} @else {
|
|
62
|
+
aspect-ratio: 1 #{"/"} #{$ug-ratio};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ---- Truncate Text ----
|
|
67
|
+
@mixin ug-truncate {
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ---- Visually Hidden (accessible) ----
|
|
74
|
+
@mixin ug-sr-only {
|
|
75
|
+
position: absolute;
|
|
76
|
+
width: 1px;
|
|
77
|
+
height: 1px;
|
|
78
|
+
padding: 0;
|
|
79
|
+
margin: -1px;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
clip: rect(0, 0, 0, 0);
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
border: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ==========================================================================
|
|
87
|
+
// Vertical Rhythm Mixins (from Gutenberg)
|
|
88
|
+
// All vertical spacing uses var(--ug-leading) which adapts at the
|
|
89
|
+
// desktop breakpoint (26px mobile → 31px desktop).
|
|
90
|
+
// ==========================================================================
|
|
91
|
+
|
|
92
|
+
// ---- Rhythm Font Size ----
|
|
93
|
+
@mixin ug-rhythm-font-size($number) {
|
|
94
|
+
font-size: #{$number}rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ---- Rhythm Line Height ----
|
|
98
|
+
@mixin ug-rhythm-line-height($number) {
|
|
99
|
+
line-height: calc(var(--ug-leading) * #{$number});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ---- Rhythm Margin ----
|
|
103
|
+
@mixin ug-rhythm-margin-top($number) {
|
|
104
|
+
margin-top: calc(var(--ug-leading) * #{$number});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@mixin ug-rhythm-margin-bottom($number) {
|
|
108
|
+
margin-bottom: calc(var(--ug-leading) * #{$number});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ---- Rhythm Padding ----
|
|
112
|
+
@mixin ug-rhythm-padding($top, $right, $bottom: null, $left: null) {
|
|
113
|
+
@if $bottom == null {
|
|
114
|
+
padding: calc(var(--ug-leading) * #{$top}) calc(var(--ug-leading) * #{$right});
|
|
115
|
+
} @else if $left == null {
|
|
116
|
+
padding: calc(var(--ug-leading) * #{$top}) calc(var(--ug-leading) * #{$right}) calc(var(--ug-leading) * #{$bottom});
|
|
117
|
+
} @else {
|
|
118
|
+
padding: calc(var(--ug-leading) * #{$top}) calc(var(--ug-leading) * #{$right}) calc(var(--ug-leading) * #{$bottom}) calc(var(--ug-leading) * #{$left});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Unigrid CSS Framework — Modal (BEM)
|
|
3
|
+
//
|
|
4
|
+
// Dialog overlay toggled via .ug-modal--open class (set by modal.js).
|
|
5
|
+
// Supports sizes, scrollable content, and close button.
|
|
6
|
+
//
|
|
7
|
+
// Block: .ug-modal
|
|
8
|
+
// Elements: __backdrop, __dialog, __header, __title, __close, __body, __footer
|
|
9
|
+
// Modifiers: --open, --sm, --lg, --full, --centered
|
|
10
|
+
// ==========================================================================
|
|
11
|
+
|
|
12
|
+
@use "variables" as *;
|
|
13
|
+
@use "mixins" as *;
|
|
14
|
+
|
|
15
|
+
.ug-modal {
|
|
16
|
+
display: none;
|
|
17
|
+
position: fixed;
|
|
18
|
+
inset: 0;
|
|
19
|
+
z-index: 200;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
padding: calc(var(--ug-leading) * 3) var(--ug-leading);
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
|
|
25
|
+
// ---- Open State ----
|
|
26
|
+
&--open {
|
|
27
|
+
display: flex;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ---- Backdrop ----
|
|
31
|
+
&__backdrop {
|
|
32
|
+
position: fixed;
|
|
33
|
+
inset: 0;
|
|
34
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
35
|
+
z-index: -1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ---- Dialog ----
|
|
39
|
+
&__dialog {
|
|
40
|
+
position: relative;
|
|
41
|
+
width: 100%;
|
|
42
|
+
max-width: 40rem;
|
|
43
|
+
background-color: $ug-white;
|
|
44
|
+
border: none;
|
|
45
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ---- Header ----
|
|
49
|
+
&__header {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: space-between;
|
|
53
|
+
padding: calc(var(--ug-leading) * 0.5);
|
|
54
|
+
background-color: $ug-black;
|
|
55
|
+
color: $ug-white;
|
|
56
|
+
|
|
57
|
+
&--light {
|
|
58
|
+
background-color: $ug-white;
|
|
59
|
+
color: $ug-black;
|
|
60
|
+
border-bottom: 1px solid $ug-light-gray;
|
|
61
|
+
|
|
62
|
+
.ug-modal__close {
|
|
63
|
+
color: $ug-medium-gray;
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
color: $ug-black;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ---- Title ----
|
|
73
|
+
&__title {
|
|
74
|
+
@include ug-font-size("lg");
|
|
75
|
+
@include ug-font-weight("bold");
|
|
76
|
+
@include ug-rhythm-line-height(1);
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ---- Close Button ----
|
|
81
|
+
&__close {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
width: var(--ug-leading);
|
|
86
|
+
height: var(--ug-leading);
|
|
87
|
+
background: none;
|
|
88
|
+
border: none;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
color: rgba(255, 255, 255, 0.7);
|
|
91
|
+
@include ug-font-size("xl");
|
|
92
|
+
@include ug-rhythm-line-height(1);
|
|
93
|
+
transition: color 0.15s;
|
|
94
|
+
padding: 0;
|
|
95
|
+
font-family: inherit;
|
|
96
|
+
margin-left: calc(var(--ug-leading) * 0.5);
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
color: $ug-white;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ---- Body ----
|
|
105
|
+
&__body {
|
|
106
|
+
padding: calc(var(--ug-leading) * 0.5);
|
|
107
|
+
@include ug-rhythm-line-height(1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// ---- Footer ----
|
|
111
|
+
&__footer {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: flex-end;
|
|
115
|
+
gap: calc(var(--ug-leading) * 0.5);
|
|
116
|
+
padding: calc(var(--ug-leading) * 0.5);
|
|
117
|
+
border-top: 1px solid $ug-light-gray;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ==============================
|
|
121
|
+
// Size Modifiers
|
|
122
|
+
// ==============================
|
|
123
|
+
|
|
124
|
+
&--sm &__dialog {
|
|
125
|
+
max-width: 24rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&--lg &__dialog {
|
|
129
|
+
max-width: 56rem;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--full &__dialog {
|
|
133
|
+
max-width: none;
|
|
134
|
+
margin: 0;
|
|
135
|
+
min-height: 100vh;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&--full {
|
|
139
|
+
padding: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ==============================
|
|
143
|
+
// Centered
|
|
144
|
+
// ==============================
|
|
145
|
+
|
|
146
|
+
&--centered {
|
|
147
|
+
align-items: center;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ==============================
|
|
151
|
+
// Body scroll lock
|
|
152
|
+
// ==============================
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// When modal is open, prevent body scroll
|
|
156
|
+
body.ug-modal-open {
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
}
|