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.
Files changed (42) hide show
  1. package/README.md +101 -0
  2. package/dist/dropdown.js +36 -0
  3. package/dist/index.js +5 -0
  4. package/dist/scrollspy.js +57 -0
  5. package/dist/tabs.js +30 -0
  6. package/dist/unigrid.css +4501 -0
  7. package/dist/unigrid.js +124 -0
  8. package/dist/unigrid.min.css +1 -0
  9. package/dist/unigrid.min.js +1 -0
  10. package/package.json +41 -0
  11. package/src/js/dropdown.js +49 -0
  12. package/src/js/index.js +19 -0
  13. package/src/js/scrollspy.js +87 -0
  14. package/src/js/tabs.js +58 -0
  15. package/src/scss/_accordion.scss +123 -0
  16. package/src/scss/_broadside.scss +125 -0
  17. package/src/scss/_buttons.scss +241 -0
  18. package/src/scss/_card.scss +168 -0
  19. package/src/scss/_components.scss +140 -0
  20. package/src/scss/_container.scss +54 -0
  21. package/src/scss/_dropdown.scss +178 -0
  22. package/src/scss/_footer.scss +147 -0
  23. package/src/scss/_formats.scss +64 -0
  24. package/src/scss/_forms.scss +192 -0
  25. package/src/scss/_grid.scss +114 -0
  26. package/src/scss/_header.scss +169 -0
  27. package/src/scss/_hero.scss +262 -0
  28. package/src/scss/_mixins.scss +120 -0
  29. package/src/scss/_modules.scss +238 -0
  30. package/src/scss/_navbar.scss +341 -0
  31. package/src/scss/_pagination.scss +160 -0
  32. package/src/scss/_prose.scss +393 -0
  33. package/src/scss/_reset.scss +82 -0
  34. package/src/scss/_scrollspy.scss +62 -0
  35. package/src/scss/_section.scss +91 -0
  36. package/src/scss/_sidebar.scss +147 -0
  37. package/src/scss/_table.scss +122 -0
  38. package/src/scss/_tabs.scss +178 -0
  39. package/src/scss/_typography.scss +105 -0
  40. package/src/scss/_utilities.scss +79 -0
  41. package/src/scss/_variables.scss +183 -0
  42. package/src/scss/unigrid.scss +49 -0
@@ -0,0 +1,192 @@
1
+ // ==========================================================================
2
+ // Unigrid CSS Framework — Forms (BEM)
3
+ //
4
+ // Block: .ug-form
5
+ // Elements: __group, __label, __input, __select, __textarea, __checkbox,
6
+ // __radio, __help, __error
7
+ // Modifiers: --inline, --disabled
8
+ // __input--sm, __input--lg
9
+ // ==========================================================================
10
+
11
+ @use "sass:color";
12
+ @use "variables" as *;
13
+ @use "mixins" as *;
14
+
15
+ .ug-form {
16
+
17
+ // ---- Form Group (label + input pair) ----
18
+ &__group {
19
+ @include ug-rhythm-margin-bottom(0.5);
20
+ }
21
+
22
+ // ---- Label ----
23
+ &__label {
24
+ display: block;
25
+ @include ug-font-size("sm");
26
+ @include ug-font-weight("bold");
27
+ @include ug-rhythm-line-height(1);
28
+ @include ug-rhythm-margin-top(0.5);
29
+ margin-bottom: 0;
30
+ color: $ug-black;
31
+ }
32
+
33
+ // ---- Text Input, Email, Password, Number, etc. ----
34
+ &__input {
35
+ display: block;
36
+ width: 100%;
37
+ height: calc(var(--ug-leading) * 1.5);
38
+ padding: 0 calc(var(--ug-leading) * 0.5);
39
+ @include ug-font-size("base");
40
+ font-family: inherit;
41
+ color: $ug-black;
42
+ background-color: $ug-white;
43
+ border: 1px solid $ug-light-gray;
44
+ transition: border-color 0.15s;
45
+
46
+ &::placeholder {
47
+ color: $ug-medium-gray;
48
+ }
49
+
50
+ &:focus {
51
+ outline: none;
52
+ border-color: $ug-black;
53
+ }
54
+
55
+ // Sizes
56
+ &--sm {
57
+ height: calc(var(--ug-leading) * 1);
58
+ @include ug-font-size("sm");
59
+ }
60
+
61
+ &--lg {
62
+ height: calc(var(--ug-leading) * 2);
63
+ @include ug-font-size("lg");
64
+ }
65
+ }
66
+
67
+ // ---- Select ----
68
+ &__select {
69
+ display: block;
70
+ width: 100%;
71
+ height: calc(var(--ug-leading) * 1.5);
72
+ padding: 0 calc(var(--ug-leading) * 1) 0 calc(var(--ug-leading) * 0.5);
73
+ @include ug-font-size("base");
74
+ font-family: inherit;
75
+ color: $ug-black;
76
+ background-color: $ug-white;
77
+ border: 1px solid $ug-light-gray;
78
+ appearance: none;
79
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='2' fill='none'/%3E%3C/svg%3E");
80
+ background-repeat: no-repeat;
81
+ background-position: right calc(var(--ug-leading) * 0.5) center;
82
+ background-size: 12px;
83
+ transition: border-color 0.15s;
84
+
85
+ &:focus {
86
+ outline: none;
87
+ border-color: $ug-black;
88
+ }
89
+ }
90
+
91
+ // ---- Textarea ----
92
+ &__textarea {
93
+ display: block;
94
+ width: 100%;
95
+ min-height: calc(var(--ug-leading) * 4);
96
+ padding: calc(var(--ug-leading) * 0.5);
97
+ @include ug-font-size("base");
98
+ @include ug-rhythm-line-height(1);
99
+ font-family: inherit;
100
+ color: $ug-black;
101
+ background-color: $ug-white;
102
+ border: 1px solid $ug-light-gray;
103
+ resize: vertical;
104
+ transition: border-color 0.15s;
105
+
106
+ &::placeholder {
107
+ color: $ug-medium-gray;
108
+ }
109
+
110
+ &:focus {
111
+ outline: none;
112
+ border-color: $ug-black;
113
+ }
114
+ }
115
+
116
+ // ---- Checkbox & Radio ----
117
+ &__checkbox,
118
+ &__radio {
119
+ display: flex;
120
+ align-items: center;
121
+ gap: calc(var(--ug-leading) * 0.5);
122
+ @include ug-rhythm-line-height(1);
123
+ @include ug-rhythm-margin-bottom(0.5);
124
+ cursor: pointer;
125
+
126
+ input {
127
+ width: 1em;
128
+ height: 1em;
129
+ margin: 0;
130
+ accent-color: $ug-black;
131
+ cursor: pointer;
132
+ }
133
+
134
+ span {
135
+ @include ug-font-size("base");
136
+ color: $ug-black;
137
+ }
138
+ }
139
+
140
+ // ---- Help Text ----
141
+ &__help {
142
+ @include ug-font-size("xs");
143
+ @include ug-rhythm-line-height(1);
144
+ color: $ug-medium-gray;
145
+ margin-top: calc(var(--ug-leading) * 0.25);
146
+ }
147
+
148
+ // ---- Error State ----
149
+ &__error {
150
+ @include ug-font-size("xs");
151
+ @include ug-rhythm-line-height(1);
152
+ color: $ug-red;
153
+ margin-top: calc(var(--ug-leading) * 0.25);
154
+ }
155
+
156
+ &__input:invalid,
157
+ &__textarea:invalid,
158
+ &__select:invalid {
159
+ border-color: $ug-red;
160
+ }
161
+
162
+ // ==============================
163
+ // Modifiers
164
+ // ==============================
165
+
166
+ // Inline form (horizontal layout)
167
+ &--inline {
168
+ display: flex;
169
+ align-items: flex-end;
170
+ gap: calc(var(--ug-leading) * 0.5);
171
+ flex-wrap: wrap;
172
+
173
+ .ug-form__group {
174
+ margin-bottom: 0;
175
+ }
176
+
177
+ .ug-form__input,
178
+ .ug-form__select {
179
+ width: auto;
180
+ }
181
+ }
182
+
183
+ // Disabled state
184
+ &--disabled,
185
+ &__input:disabled,
186
+ &__select:disabled,
187
+ &__textarea:disabled {
188
+ opacity: 0.5;
189
+ cursor: not-allowed;
190
+ pointer-events: none;
191
+ }
192
+ }
@@ -0,0 +1,114 @@
1
+ // ==========================================================================
2
+ // Unigrid CSS Framework — Grid System (BEM)
3
+ //
4
+ // Block: .ug-grid
5
+ // Elements: (children use .ug-grid__col-{n})
6
+ // Modifiers: --no-gap, --dense, --rows
7
+ // ==========================================================================
8
+
9
+ // ---- Grid Block ----
10
+
11
+
12
+ @use "variables" as *;
13
+ @use "mixins" as *;
14
+
15
+ .ug-grid {
16
+ display: grid;
17
+ grid-template-columns: repeat($ug-columns, 1fr);
18
+ gap: var(--ug-leading);
19
+ width: 100%;
20
+
21
+ // -- Modifiers --
22
+ &--no-gap {
23
+ gap: 0;
24
+ }
25
+
26
+ &--dense {
27
+ grid-auto-flow: dense;
28
+ }
29
+
30
+ &--rows {
31
+ grid-template-rows: repeat($ug-rows, 1fr);
32
+ }
33
+ }
34
+
35
+ // ---- Column Spans ----
36
+ // .ug-col--{1-12}
37
+
38
+ @for $i from 1 through $ug-columns {
39
+ .ug-col--#{$i} {
40
+ grid-column: span $i;
41
+ }
42
+ }
43
+
44
+ // ---- Column Start Positions ----
45
+ // .ug-col--start-{1-12}
46
+
47
+ @for $i from 1 through $ug-columns {
48
+ .ug-col--start-#{$i} {
49
+ grid-column-start: $i;
50
+ }
51
+ }
52
+
53
+ // ---- Row Spans ----
54
+ // .ug-row--{1-10}
55
+
56
+ @for $i from 1 through 10 {
57
+ .ug-row--#{$i} {
58
+ grid-row: span $i;
59
+ }
60
+ }
61
+
62
+ // ---- Row Start Positions ----
63
+ // .ug-row--start-{1-10}
64
+
65
+ @for $i from 1 through 10 {
66
+ .ug-row--start-#{$i} {
67
+ grid-row-start: $i;
68
+ }
69
+ }
70
+
71
+ // ---- Subgrid ----
72
+
73
+ .ug-subgrid {
74
+ display: grid;
75
+ grid-template-columns: subgrid;
76
+
77
+ &--rows {
78
+ grid-template-rows: subgrid;
79
+ }
80
+ }
81
+
82
+ // ---- Responsive Column Spans ----
83
+ // .ug-col--{bp}-{1-12}
84
+
85
+ @each $bp-name, $bp-value in $ug-breakpoints {
86
+ @media (min-width: $bp-value) {
87
+ @for $i from 1 through $ug-columns {
88
+ .ug-col--#{$bp-name}-#{$i} {
89
+ grid-column: span $i;
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ // ---- Alignment Utilities ----
96
+
97
+ .ug-align {
98
+ &--start { align-self: start; }
99
+ &--center { align-self: center; }
100
+ &--end { align-self: end; }
101
+ &--stretch { align-self: stretch; }
102
+ }
103
+
104
+ .ug-justify {
105
+ &--start { justify-self: start; }
106
+ &--center { justify-self: center; }
107
+ &--end { justify-self: end; }
108
+ &--stretch { justify-self: stretch; }
109
+ }
110
+
111
+ .ug-place--center {
112
+ align-self: center;
113
+ justify-self: center;
114
+ }
@@ -0,0 +1,169 @@
1
+ // ==========================================================================
2
+ // Unigrid CSS Framework — Header Bar (BEM)
3
+ //
4
+ // The signature black header band spanning the full broadside width.
5
+ // Can embed a .ug-navbar inside for an integrated header+nav layout.
6
+ //
7
+ // Block: .ug-header
8
+ // Elements: __logo, __title, __name, __subtitle, __nav
9
+ // Modifiers: --compact, --brown, --full
10
+ // ==========================================================================
11
+
12
+
13
+ @use "variables" as *;
14
+ @use "mixins" as *;
15
+
16
+ .ug-header {
17
+ display: flex;
18
+ align-items: flex-start;
19
+ gap: var(--ug-leading);
20
+ background-color: $ug-black;
21
+ color: $ug-white;
22
+ padding: var(--ug-leading) calc(var(--ug-leading) * 1.5);
23
+ width: 100%;
24
+ grid-column: 1 / -1;
25
+ flex-wrap: wrap;
26
+
27
+ // -- Elements --
28
+ &__logo {
29
+ height: calc(var(--ug-leading) * 3);
30
+ flex-shrink: 0;
31
+
32
+ img,
33
+ svg {
34
+ height: 100%;
35
+ width: auto;
36
+ }
37
+ }
38
+
39
+ &__title {
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 0;
43
+ flex-shrink: 0;
44
+
45
+ h1, a {
46
+ @include ug-font-size("3xl");
47
+ @include ug-font-weight("bold");
48
+ @include ug-rhythm-line-height(2);
49
+ letter-spacing: -0.02em;
50
+ text-transform: none;
51
+ margin: 0;
52
+ }
53
+
54
+ a {
55
+ text-decoration: none;
56
+ }
57
+ }
58
+
59
+ &__name {
60
+ @include ug-font-size("3xl");
61
+ @include ug-font-weight("bold");
62
+ @include ug-rhythm-line-height(2);
63
+ letter-spacing: -0.02em;
64
+ margin: 0;
65
+ flex-shrink: 0;
66
+ }
67
+
68
+ &__subtitle {
69
+ @include ug-font-size("lg");
70
+ @include ug-font-weight("light");
71
+ @include ug-rhythm-line-height(1);
72
+ opacity: 0.85;
73
+ margin: 0;
74
+ }
75
+
76
+ // -- Embedded Navbar --
77
+ .ug-navbar {
78
+ flex: 1;
79
+ background: transparent;
80
+ border: none;
81
+ min-height: 0;
82
+
83
+ &__inner {
84
+ padding: 0;
85
+ max-width: none;
86
+ min-height: 0;
87
+ justify-content: flex-end;
88
+ align-items: flex-start;
89
+ }
90
+
91
+ &__brand {
92
+ display: none;
93
+ }
94
+
95
+ &__link {
96
+ color: rgba(255, 255, 255, 0.7);
97
+
98
+ &:hover {
99
+ color: $ug-white;
100
+ background-color: rgba(255, 255, 255, 0.1);
101
+ }
102
+
103
+ &--active {
104
+ color: $ug-white;
105
+ }
106
+ }
107
+
108
+ &__toggle {
109
+ color: $ug-white;
110
+ }
111
+
112
+ &__divider {
113
+ background-color: rgba(255, 255, 255, 0.15);
114
+ }
115
+
116
+ &__menu {
117
+ @include ug-breakpoint-down("md") {
118
+ background-color: $ug-black;
119
+ }
120
+ }
121
+ }
122
+
123
+ // -- Modifiers --
124
+ &--compact {
125
+ padding: calc(var(--ug-leading) * 0.5) calc(var(--ug-leading) * 1.5);
126
+
127
+ .ug-header__logo {
128
+ width: auto;
129
+ height: calc(var(--ug-leading) * 2);
130
+ }
131
+
132
+ .ug-header__title h1,
133
+ .ug-header__title a,
134
+ .ug-header__name {
135
+ @include ug-font-size("2xl");
136
+ @include ug-rhythm-line-height(1);
137
+ }
138
+
139
+ .ug-header__subtitle {
140
+ @include ug-font-size("sm");
141
+ @include ug-rhythm-line-height(1);
142
+ }
143
+ }
144
+
145
+ &--brown {
146
+ background-color: $ug-brown;
147
+ }
148
+
149
+ &--full {
150
+ grid-column: 1 / -1;
151
+ }
152
+
153
+ // -- Responsive --
154
+ @include ug-breakpoint-down("md") {
155
+ &__title h1,
156
+ &__title a,
157
+ &__name {
158
+ @include ug-font-size("2xl");
159
+ }
160
+
161
+ &__subtitle {
162
+ @include ug-font-size("base");
163
+ }
164
+
165
+ &__logo {
166
+ width: 2.5rem;
167
+ }
168
+ }
169
+ }