unigrid.css 0.3.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/README.md +101 -0
- package/dist/dropdown.js +36 -0
- package/dist/index.js +5 -0
- package/dist/scrollspy.js +57 -0
- package/dist/tabs.js +30 -0
- package/dist/unigrid.css +4501 -0
- package/dist/unigrid.js +124 -0
- package/dist/unigrid.min.css +1 -0
- package/dist/unigrid.min.js +1 -0
- package/package.json +41 -0
- package/src/js/dropdown.js +49 -0
- package/src/js/index.js +19 -0
- package/src/js/scrollspy.js +87 -0
- package/src/js/tabs.js +58 -0
- package/src/scss/_accordion.scss +123 -0
- package/src/scss/_broadside.scss +125 -0
- package/src/scss/_buttons.scss +241 -0
- package/src/scss/_card.scss +168 -0
- package/src/scss/_components.scss +140 -0
- package/src/scss/_container.scss +54 -0
- package/src/scss/_dropdown.scss +178 -0
- package/src/scss/_footer.scss +147 -0
- package/src/scss/_formats.scss +64 -0
- package/src/scss/_forms.scss +192 -0
- package/src/scss/_grid.scss +114 -0
- package/src/scss/_header.scss +169 -0
- package/src/scss/_hero.scss +262 -0
- package/src/scss/_mixins.scss +120 -0
- package/src/scss/_modules.scss +238 -0
- package/src/scss/_navbar.scss +341 -0
- package/src/scss/_pagination.scss +160 -0
- package/src/scss/_prose.scss +393 -0
- package/src/scss/_reset.scss +82 -0
- package/src/scss/_scrollspy.scss +62 -0
- package/src/scss/_section.scss +91 -0
- package/src/scss/_sidebar.scss +147 -0
- package/src/scss/_table.scss +122 -0
- package/src/scss/_tabs.scss +178 -0
- package/src/scss/_typography.scss +105 -0
- package/src/scss/_utilities.scss +79 -0
- package/src/scss/_variables.scss +183 -0
- package/src/scss/unigrid.scss +49 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Unigrid CSS Framework — Accordion (BEM)
|
|
3
|
+
//
|
|
4
|
+
// Pure HTML/CSS accordion using <details>/<summary>. No JS required.
|
|
5
|
+
// Caret rotates when open.
|
|
6
|
+
//
|
|
7
|
+
// Block: .ug-accordion
|
|
8
|
+
// Elements: __item, __header, __caret, __body
|
|
9
|
+
// Modifiers: --bordered, --flush, --dark
|
|
10
|
+
// ==========================================================================
|
|
11
|
+
|
|
12
|
+
@use "variables" as *;
|
|
13
|
+
@use "mixins" as *;
|
|
14
|
+
|
|
15
|
+
.ug-accordion {
|
|
16
|
+
|
|
17
|
+
// ---- Item (details element) ----
|
|
18
|
+
&__item {
|
|
19
|
+
border-bottom: 1px solid $ug-light-gray;
|
|
20
|
+
|
|
21
|
+
&[open] > .ug-accordion__header .ug-accordion__caret {
|
|
22
|
+
transform: rotate(-135deg);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ---- Header (summary element) ----
|
|
27
|
+
&__header {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
padding: calc(var(--ug-leading) * 0.5) 0;
|
|
32
|
+
@include ug-font-size("base");
|
|
33
|
+
@include ug-font-weight("bold");
|
|
34
|
+
@include ug-rhythm-line-height(1);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
list-style: none;
|
|
37
|
+
user-select: none;
|
|
38
|
+
transition: color 0.15s;
|
|
39
|
+
|
|
40
|
+
&::-webkit-details-marker {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&::marker {
|
|
45
|
+
content: "";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
color: $ug-medium-gray;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ---- Caret ----
|
|
54
|
+
&__caret {
|
|
55
|
+
display: inline-block;
|
|
56
|
+
width: 0.6em;
|
|
57
|
+
height: 0.6em;
|
|
58
|
+
border-right: 2px solid currentColor;
|
|
59
|
+
border-bottom: 2px solid currentColor;
|
|
60
|
+
transform: rotate(45deg);
|
|
61
|
+
transition: transform 0.2s;
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
margin-left: var(--ug-leading);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ---- Body ----
|
|
67
|
+
&__body {
|
|
68
|
+
padding: 0 0 var(--ug-leading) 0;
|
|
69
|
+
@include ug-font-size("sm");
|
|
70
|
+
@include ug-rhythm-line-height(1);
|
|
71
|
+
color: $ug-dark-gray;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ==============================
|
|
75
|
+
// Modifiers
|
|
76
|
+
// ==============================
|
|
77
|
+
|
|
78
|
+
// Bordered: border on all sides
|
|
79
|
+
&--bordered {
|
|
80
|
+
border: 1px solid $ug-light-gray;
|
|
81
|
+
|
|
82
|
+
.ug-accordion__item {
|
|
83
|
+
border-bottom: 1px solid $ug-light-gray;
|
|
84
|
+
|
|
85
|
+
&:last-child {
|
|
86
|
+
border-bottom: none;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ug-accordion__header {
|
|
91
|
+
padding: calc(var(--ug-leading) * 0.5) var(--ug-leading);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ug-accordion__body {
|
|
95
|
+
padding: 0 var(--ug-leading) var(--ug-leading);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Flush: no borders at all
|
|
100
|
+
&--flush {
|
|
101
|
+
.ug-accordion__item {
|
|
102
|
+
border-bottom: none;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Dark
|
|
107
|
+
&--dark {
|
|
108
|
+
background-color: $ug-black;
|
|
109
|
+
color: $ug-white;
|
|
110
|
+
|
|
111
|
+
.ug-accordion__item {
|
|
112
|
+
border-bottom-color: rgba(255, 255, 255, 0.1);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ug-accordion__header:hover {
|
|
116
|
+
color: rgba(255, 255, 255, 0.6);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ug-accordion__body {
|
|
120
|
+
color: rgba(255, 255, 255, 0.7);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Unigrid CSS Framework — Broadside & Panel Layout (BEM)
|
|
3
|
+
//
|
|
4
|
+
// The broadside is the fully opened, unfolded sheet.
|
|
5
|
+
// A-series: 1 panel wide × N panels long → single row of panels
|
|
6
|
+
// B-series: 2 panels wide × N panels long → two rows of panels
|
|
7
|
+
//
|
|
8
|
+
// Block: .ug-broadside
|
|
9
|
+
// Elements: (children are .ug-panel blocks)
|
|
10
|
+
// Modifiers: --full-height, --din, --stack
|
|
11
|
+
//
|
|
12
|
+
// Block: .ug-panel
|
|
13
|
+
// Elements: __header, __body, __footer
|
|
14
|
+
// Modifiers: --flush, --dark, --gray, --accent, --span-{n}
|
|
15
|
+
// ==========================================================================
|
|
16
|
+
|
|
17
|
+
// ---- Broadside Block ----
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@use "variables" as *;
|
|
21
|
+
@use "mixins" as *;
|
|
22
|
+
|
|
23
|
+
.ug-broadside {
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: repeat(var(--ug-format-cols, $ug-columns), 1fr);
|
|
26
|
+
gap: var(--ug-leading);
|
|
27
|
+
width: 100%;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
|
|
30
|
+
&--full-height {
|
|
31
|
+
min-height: 100vh;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--din {
|
|
35
|
+
@include ug-ratio-din(true);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&--stack {
|
|
39
|
+
@include ug-breakpoint-down("md") {
|
|
40
|
+
grid-template-columns: 1fr;
|
|
41
|
+
|
|
42
|
+
> .ug-panel {
|
|
43
|
+
grid-column: span 1;
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
> .ug-fold {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ---- Panel Block ----
|
|
55
|
+
|
|
56
|
+
.ug-panel {
|
|
57
|
+
grid-column: span 1;
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: subgrid;
|
|
60
|
+
grid-template-rows: auto 1fr auto;
|
|
61
|
+
padding: var(--ug-leading);
|
|
62
|
+
min-height: 0;
|
|
63
|
+
|
|
64
|
+
// -- Elements --
|
|
65
|
+
&__header {
|
|
66
|
+
grid-row: 1;
|
|
67
|
+
grid-column: 1 / -1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__body {
|
|
71
|
+
grid-row: 2;
|
|
72
|
+
grid-column: 1 / -1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__footer {
|
|
76
|
+
grid-row: 3;
|
|
77
|
+
grid-column: 1 / -1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// -- Modifiers --
|
|
81
|
+
&--flush {
|
|
82
|
+
padding: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--dark {
|
|
86
|
+
background-color: $ug-black;
|
|
87
|
+
color: $ug-white;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--gray {
|
|
91
|
+
background-color: $ug-warm-gray;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--accent {
|
|
95
|
+
background-color: $ug-red;
|
|
96
|
+
color: $ug-white;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// -- Span modifiers for multi-column panels --
|
|
100
|
+
@for $i from 2 through 6 {
|
|
101
|
+
&--span-#{$i} {
|
|
102
|
+
grid-column: span $i;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ---- Fold Lines ----
|
|
108
|
+
|
|
109
|
+
.ug-fold {
|
|
110
|
+
grid-row: 1 / -1;
|
|
111
|
+
width: 1px;
|
|
112
|
+
background-color: $ug-light-gray;
|
|
113
|
+
justify-self: end;
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
|
|
116
|
+
&--dashed {
|
|
117
|
+
background: repeating-linear-gradient(
|
|
118
|
+
to bottom,
|
|
119
|
+
$ug-light-gray 0,
|
|
120
|
+
$ug-light-gray 6px,
|
|
121
|
+
transparent 6px,
|
|
122
|
+
transparent 12px
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Unigrid CSS Framework — Buttons (BEM)
|
|
3
|
+
//
|
|
4
|
+
// Block: .ug-btn
|
|
5
|
+
// Elements: __icon
|
|
6
|
+
// Modifiers: --black, --brown, --red, --green, --blue, --light, --ghost,
|
|
7
|
+
// --sm, --lg, --block, --disabled
|
|
8
|
+
// ==========================================================================
|
|
9
|
+
|
|
10
|
+
@use "sass:color";
|
|
11
|
+
@use "variables" as *;
|
|
12
|
+
@use "mixins" as *;
|
|
13
|
+
|
|
14
|
+
.ug-btn {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
gap: calc(var(--ug-leading) * 0.5);
|
|
19
|
+
height: calc(var(--ug-leading) * 1.5);
|
|
20
|
+
padding: 0 var(--ug-leading);
|
|
21
|
+
@include ug-font-size("base");
|
|
22
|
+
@include ug-font-weight("bold");
|
|
23
|
+
font-family: inherit;
|
|
24
|
+
text-decoration: none;
|
|
25
|
+
text-align: center;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
border: 2px solid $ug-black;
|
|
29
|
+
background-color: $ug-black;
|
|
30
|
+
color: $ug-white;
|
|
31
|
+
transition: background-color 0.15s, border-color 0.15s, color 0.15s;
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
background-color: $ug-dark-gray;
|
|
35
|
+
border-color: $ug-dark-gray;
|
|
36
|
+
color: $ug-white;
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:active {
|
|
41
|
+
background-color: color.adjust($ug-black, $lightness: -5%);
|
|
42
|
+
border-color: color.adjust($ug-black, $lightness: -5%);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ==============================
|
|
46
|
+
// Color Variants
|
|
47
|
+
// ==============================
|
|
48
|
+
|
|
49
|
+
&--brown {
|
|
50
|
+
background-color: $ug-brown;
|
|
51
|
+
border-color: $ug-brown;
|
|
52
|
+
|
|
53
|
+
&:hover {
|
|
54
|
+
background-color: color.adjust($ug-brown, $lightness: 8%);
|
|
55
|
+
border-color: color.adjust($ug-brown, $lightness: 8%);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--red {
|
|
60
|
+
background-color: $ug-red;
|
|
61
|
+
border-color: $ug-red;
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
background-color: color.adjust($ug-red, $lightness: 8%);
|
|
65
|
+
border-color: color.adjust($ug-red, $lightness: 8%);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--green {
|
|
70
|
+
background-color: $ug-green;
|
|
71
|
+
border-color: $ug-green;
|
|
72
|
+
|
|
73
|
+
&:hover {
|
|
74
|
+
background-color: color.adjust($ug-green, $lightness: 8%);
|
|
75
|
+
border-color: color.adjust($ug-green, $lightness: 8%);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--blue {
|
|
80
|
+
background-color: $ug-blue;
|
|
81
|
+
border-color: $ug-blue;
|
|
82
|
+
|
|
83
|
+
&:hover {
|
|
84
|
+
background-color: color.adjust($ug-blue, $lightness: 8%);
|
|
85
|
+
border-color: color.adjust($ug-blue, $lightness: 8%);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Light: dark text on light bg
|
|
90
|
+
&--light {
|
|
91
|
+
background-color: $ug-warm-gray;
|
|
92
|
+
border-color: $ug-warm-gray;
|
|
93
|
+
color: $ug-black;
|
|
94
|
+
|
|
95
|
+
&:hover {
|
|
96
|
+
background-color: color.adjust($ug-warm-gray, $lightness: -5%);
|
|
97
|
+
border-color: color.adjust($ug-warm-gray, $lightness: -5%);
|
|
98
|
+
color: $ug-black;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ==============================
|
|
103
|
+
// Outline / Ghost Variants
|
|
104
|
+
// ==============================
|
|
105
|
+
|
|
106
|
+
// Outline: transparent bg, colored border + text
|
|
107
|
+
&--outline {
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
color: $ug-black;
|
|
110
|
+
|
|
111
|
+
&:hover {
|
|
112
|
+
background-color: $ug-black;
|
|
113
|
+
color: $ug-white;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Outline color variants
|
|
117
|
+
&.ug-btn--brown {
|
|
118
|
+
border-color: $ug-brown;
|
|
119
|
+
color: $ug-brown;
|
|
120
|
+
background-color: transparent;
|
|
121
|
+
&:hover { background-color: $ug-brown; color: $ug-white; }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.ug-btn--red {
|
|
125
|
+
border-color: $ug-red;
|
|
126
|
+
color: $ug-red;
|
|
127
|
+
background-color: transparent;
|
|
128
|
+
&:hover { background-color: $ug-red; color: $ug-white; }
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&.ug-btn--green {
|
|
132
|
+
border-color: $ug-green;
|
|
133
|
+
color: $ug-green;
|
|
134
|
+
background-color: transparent;
|
|
135
|
+
&:hover { background-color: $ug-green; color: $ug-white; }
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.ug-btn--blue {
|
|
139
|
+
border-color: $ug-blue;
|
|
140
|
+
color: $ug-blue;
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
&:hover { background-color: $ug-blue; color: $ug-white; }
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&.ug-btn--light {
|
|
146
|
+
border-color: $ug-light-gray;
|
|
147
|
+
color: $ug-dark-gray;
|
|
148
|
+
background-color: transparent;
|
|
149
|
+
&:hover { background-color: $ug-warm-gray; color: $ug-black; }
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Ghost: no border, just text with hover bg
|
|
154
|
+
&--ghost {
|
|
155
|
+
background-color: transparent;
|
|
156
|
+
border-color: transparent;
|
|
157
|
+
color: $ug-black;
|
|
158
|
+
|
|
159
|
+
&:hover {
|
|
160
|
+
background-color: $ug-warm-gray;
|
|
161
|
+
border-color: $ug-warm-gray;
|
|
162
|
+
color: $ug-black;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ==============================
|
|
167
|
+
// Size Variants
|
|
168
|
+
// ==============================
|
|
169
|
+
|
|
170
|
+
// sm = 1 leading height
|
|
171
|
+
&--sm {
|
|
172
|
+
@include ug-font-size("sm");
|
|
173
|
+
height: var(--ug-leading);
|
|
174
|
+
padding: 0 calc(var(--ug-leading) * 0.5);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// lg = 2 leading height
|
|
178
|
+
&--lg {
|
|
179
|
+
@include ug-font-size("lg");
|
|
180
|
+
height: calc(var(--ug-leading) * 2);
|
|
181
|
+
padding: 0 calc(var(--ug-leading) * 1.5);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// ==============================
|
|
185
|
+
// Layout Variants
|
|
186
|
+
// ==============================
|
|
187
|
+
|
|
188
|
+
// Full width
|
|
189
|
+
&--block {
|
|
190
|
+
display: flex;
|
|
191
|
+
width: 100%;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// ==============================
|
|
195
|
+
// States
|
|
196
|
+
// ==============================
|
|
197
|
+
|
|
198
|
+
&--disabled,
|
|
199
|
+
&:disabled {
|
|
200
|
+
opacity: 0.4;
|
|
201
|
+
cursor: not-allowed;
|
|
202
|
+
pointer-events: none;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ==============================
|
|
206
|
+
// Icon element
|
|
207
|
+
// ==============================
|
|
208
|
+
|
|
209
|
+
&__icon {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
width: 1em;
|
|
212
|
+
height: 1em;
|
|
213
|
+
flex-shrink: 0;
|
|
214
|
+
|
|
215
|
+
svg {
|
|
216
|
+
width: 100%;
|
|
217
|
+
height: 100%;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// ==============================
|
|
222
|
+
// Button Group
|
|
223
|
+
// ==============================
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.ug-btn-group {
|
|
227
|
+
display: inline-flex;
|
|
228
|
+
gap: 0;
|
|
229
|
+
|
|
230
|
+
.ug-btn {
|
|
231
|
+
border-radius: 0;
|
|
232
|
+
|
|
233
|
+
&:not(:last-child) {
|
|
234
|
+
border-right-width: 1px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&:not(:first-child) {
|
|
238
|
+
border-left-width: 1px;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// ==========================================================================
|
|
2
|
+
// Unigrid CSS Framework — Card (BEM)
|
|
3
|
+
//
|
|
4
|
+
// Block: .ug-card
|
|
5
|
+
// Elements: __image, __body, __title, __subtitle, __text, __footer, __actions
|
|
6
|
+
// Modifiers: --dark, --bordered, --flat, --horizontal
|
|
7
|
+
// ==========================================================================
|
|
8
|
+
|
|
9
|
+
@use "variables" as *;
|
|
10
|
+
@use "mixins" as *;
|
|
11
|
+
|
|
12
|
+
.ug-card {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
background-color: $ug-white;
|
|
16
|
+
border: 1px solid $ug-light-gray;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
|
|
19
|
+
// ---- Image ----
|
|
20
|
+
&__image {
|
|
21
|
+
display: block;
|
|
22
|
+
width: 100%;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
|
|
25
|
+
img {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Fixed aspect ratios
|
|
33
|
+
&--square { aspect-ratio: 1; }
|
|
34
|
+
&--landscape { aspect-ratio: 16 / 9; }
|
|
35
|
+
&--din { aspect-ratio: 1.4142 / 1; }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ---- Body ----
|
|
39
|
+
&__body {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
flex: 1;
|
|
43
|
+
padding: var(--ug-leading) calc(var(--ug-leading) * 1.5);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ---- Title ----
|
|
47
|
+
&__title {
|
|
48
|
+
@include ug-rhythm-font-size(1.2);
|
|
49
|
+
@include ug-rhythm-line-height(1);
|
|
50
|
+
@include ug-font-weight("bold");
|
|
51
|
+
@include ug-rhythm-margin-bottom(0.5);
|
|
52
|
+
margin-top: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ---- Subtitle ----
|
|
56
|
+
&__subtitle {
|
|
57
|
+
@include ug-font-size("sm");
|
|
58
|
+
@include ug-rhythm-line-height(1);
|
|
59
|
+
color: $ug-medium-gray;
|
|
60
|
+
margin-top: 0;
|
|
61
|
+
@include ug-rhythm-margin-bottom(0.5);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ---- Text ----
|
|
65
|
+
&__text {
|
|
66
|
+
@include ug-font-size("sm");
|
|
67
|
+
@include ug-rhythm-line-height(1);
|
|
68
|
+
color: $ug-dark-gray;
|
|
69
|
+
flex: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ---- Footer ----
|
|
73
|
+
&__footer {
|
|
74
|
+
padding: calc(var(--ug-leading) * 0.5) calc(var(--ug-leading) * 1.5);
|
|
75
|
+
border-top: 1px solid $ug-light-gray;
|
|
76
|
+
@include ug-font-size("xs");
|
|
77
|
+
@include ug-rhythm-line-height(1);
|
|
78
|
+
color: $ug-medium-gray;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ---- Actions (buttons area) ----
|
|
82
|
+
&__actions {
|
|
83
|
+
display: flex;
|
|
84
|
+
gap: calc(var(--ug-leading) * 0.5);
|
|
85
|
+
padding: var(--ug-leading) calc(var(--ug-leading) * 1.5);
|
|
86
|
+
padding-top: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ==============================
|
|
90
|
+
// Modifiers
|
|
91
|
+
// ==============================
|
|
92
|
+
|
|
93
|
+
// Dark card
|
|
94
|
+
&--dark {
|
|
95
|
+
background-color: $ug-black;
|
|
96
|
+
border-color: $ug-black;
|
|
97
|
+
color: $ug-white;
|
|
98
|
+
|
|
99
|
+
.ug-card__text { color: rgba(255, 255, 255, 0.7); }
|
|
100
|
+
.ug-card__subtitle { color: rgba(255, 255, 255, 0.5); }
|
|
101
|
+
.ug-card__footer { border-top-color: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); }
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Bordered (heavier border)
|
|
105
|
+
&--bordered {
|
|
106
|
+
border-width: 2px;
|
|
107
|
+
border-color: $ug-black;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Flat (no border, shadow instead)
|
|
111
|
+
&--flat {
|
|
112
|
+
border: none;
|
|
113
|
+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Horizontal layout (image left, body right)
|
|
117
|
+
&--horizontal {
|
|
118
|
+
flex-direction: row;
|
|
119
|
+
|
|
120
|
+
.ug-card__image {
|
|
121
|
+
width: 40%;
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
|
|
124
|
+
img { height: 100%; }
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ug-card__body {
|
|
128
|
+
flex: 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@include ug-breakpoint-down("md") {
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
|
|
134
|
+
.ug-card__image {
|
|
135
|
+
width: 100%;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// NPS color accents (top border)
|
|
141
|
+
&--accent-red { border-top: 3px solid $ug-red; }
|
|
142
|
+
&--accent-brown { border-top: 3px solid $ug-brown; }
|
|
143
|
+
&--accent-green { border-top: 3px solid $ug-green; }
|
|
144
|
+
&--accent-blue { border-top: 3px solid $ug-blue; }
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ---- Card Grid Helper ----
|
|
148
|
+
// Responsive card grid using CSS grid
|
|
149
|
+
|
|
150
|
+
.ug-card-grid {
|
|
151
|
+
display: grid;
|
|
152
|
+
gap: var(--ug-leading);
|
|
153
|
+
|
|
154
|
+
&--2 { grid-template-columns: repeat(2, 1fr); }
|
|
155
|
+
&--3 { grid-template-columns: repeat(3, 1fr); }
|
|
156
|
+
&--4 { grid-template-columns: repeat(4, 1fr); }
|
|
157
|
+
|
|
158
|
+
@include ug-breakpoint-down("lg") {
|
|
159
|
+
&--4 { grid-template-columns: repeat(2, 1fr); }
|
|
160
|
+
&--3 { grid-template-columns: repeat(2, 1fr); }
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@include ug-breakpoint-down("md") {
|
|
164
|
+
&--2,
|
|
165
|
+
&--3,
|
|
166
|
+
&--4 { grid-template-columns: 1fr; }
|
|
167
|
+
}
|
|
168
|
+
}
|