@razerspine/pug-ui-kit 1.0.1 → 1.1.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 (70) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +113 -20
  3. package/index.js +9 -1
  4. package/less/base/_fonts.less +44 -0
  5. package/less/base/_index.less +2 -0
  6. package/less/base/_reset.less +155 -0
  7. package/less/components/_aside.less +49 -0
  8. package/less/components/_buttons.less +156 -0
  9. package/less/components/_footer.less +25 -0
  10. package/less/components/_form-control.less +27 -0
  11. package/less/components/_form-textarea.less +7 -0
  12. package/less/components/_forms.less +76 -0
  13. package/less/components/_header.less +57 -0
  14. package/less/components/_icons.less +42 -0
  15. package/less/components/_index.less +14 -0
  16. package/less/components/_input-base.less +48 -0
  17. package/less/components/_input-checkbox.less +10 -0
  18. package/less/components/_input-radio.less +10 -0
  19. package/less/components/_main.less +32 -0
  20. package/less/components/_single-select.less +29 -0
  21. package/less/components/_table.less +45 -0
  22. package/less/layout/_grid.less +104 -0
  23. package/less/layout/_index.less +2 -0
  24. package/less/layout/_layout.less +55 -0
  25. package/less/settings/_breakpoints.less +5 -0
  26. package/less/settings/_index.less +3 -0
  27. package/less/settings/_typography.less +2 -0
  28. package/less/settings/_variables.less +13 -0
  29. package/less/themes/_dark.less +25 -0
  30. package/less/themes/_index.less +2 -0
  31. package/less/themes/_light.less +49 -0
  32. package/less/ui-kit.less +6 -0
  33. package/less/utils/_helpers.less +32 -0
  34. package/less/utils/_index.less +3 -0
  35. package/less/utils/_mixins.less +36 -0
  36. package/less/utils/_utilities.less +400 -0
  37. package/package.json +5 -1
  38. package/scss/base/_fonts.scss +44 -0
  39. package/scss/base/_index.scss +2 -0
  40. package/scss/base/_reset.scss +155 -0
  41. package/scss/components/_aside.scss +47 -0
  42. package/scss/components/_buttons.scss +158 -0
  43. package/scss/components/_footer.scss +25 -0
  44. package/scss/components/_form-control.scss +27 -0
  45. package/scss/components/_form-textarea.scss +7 -0
  46. package/scss/components/_forms.scss +75 -0
  47. package/scss/components/_header.scss +57 -0
  48. package/scss/components/_icons.scss +42 -0
  49. package/scss/components/_index.scss +14 -0
  50. package/scss/components/_input-base.scss +48 -0
  51. package/scss/components/_input-checkbox.scss +10 -0
  52. package/scss/components/_input-radio.scss +10 -0
  53. package/scss/components/_main.scss +24 -0
  54. package/scss/components/_single-select.scss +29 -0
  55. package/scss/components/_table.scss +45 -0
  56. package/scss/layout/_grid.scss +64 -0
  57. package/scss/layout/_index.scss +2 -0
  58. package/scss/layout/_layout.scss +49 -0
  59. package/scss/settings/_breakpoints.scss +7 -0
  60. package/scss/settings/_index.scss +3 -0
  61. package/scss/settings/_typography.scss +2 -0
  62. package/scss/settings/_variables.scss +13 -0
  63. package/scss/themes/_dark.scss +25 -0
  64. package/scss/themes/_index.scss +2 -0
  65. package/scss/themes/_light.scss +49 -0
  66. package/scss/ui-kit.scss +6 -0
  67. package/scss/utils/_helpers.scss +18 -0
  68. package/scss/utils/_index.scss +3 -0
  69. package/scss/utils/_mixins.scss +16 -0
  70. package/scss/utils/_utilities.scss +305 -0
@@ -0,0 +1,36 @@
1
+ @import '../settings/_index';
2
+
3
+ .breakpoint(@key) when (@key = sm) {
4
+ @bp: @breakpoint-sm;
5
+ }
6
+
7
+ .breakpoint(@key) when (@key = md) {
8
+ @bp: @breakpoint-md;
9
+ }
10
+
11
+ .breakpoint(@key) when (@key = lg) {
12
+ @bp: @breakpoint-lg;
13
+ }
14
+
15
+ .breakpoint(@key) when (@key = xl) {
16
+ @bp: @breakpoint-xl;
17
+ }
18
+
19
+ .breakpoint(@key) when not (@key = sm) and not (@key = md) and not (@key = lg) and not (@key = xl) {
20
+ @bp: 0;
21
+ }
22
+
23
+ /* respond-to: використання через вкладений блок .-inner-content() */
24
+ .respond-to(@key) {
25
+ .breakpoint(@key);
26
+ .-with-bp() when not (@bp = 0) {
27
+ @media (min-width: @bp) {
28
+ .-inner-content();
29
+ }
30
+ }
31
+ .-without-bp() when (@bp = 0) {
32
+ .-inner-content();
33
+ }
34
+ .-with-bp();
35
+ .-without-bp();
36
+ }
@@ -0,0 +1,400 @@
1
+ @import '_helpers';
2
+
3
+ // Space scale
4
+ @space-0: 0rem;
5
+ @space-1: 0.5rem;
6
+ @space-2: 1rem;
7
+ @space-3: 1.5rem;
8
+ @space-4: 2rem;
9
+
10
+ /* -------------------------
11
+ Helper: get-space(@s) -> @space-value
12
+ Usage: call .get-space(@s) then use @space-value
13
+ ------------------------- */
14
+ .get-space(@s) when (@s = 0) {
15
+ @space-value: @space-0;
16
+ }
17
+
18
+ .get-space(@s) when (@s = 1) {
19
+ @space-value: @space-1;
20
+ }
21
+
22
+ .get-space(@s) when (@s = 2) {
23
+ @space-value: @space-2;
24
+ }
25
+
26
+ .get-space(@s) when (@s = 3) {
27
+ @space-value: @space-3;
28
+ }
29
+
30
+ .get-space(@s) when (@s = 4) {
31
+ @space-value: @space-4;
32
+ }
33
+
34
+ .get-space(@s) when not (@s = 0) and not (@s = 1) and not (@s = 2) and not (@s = 3) and not (@s = 4) {
35
+ // fallback
36
+ @space-value: 0rem;
37
+ }
38
+
39
+ /* -------------------------
40
+ Generate margin/padding utilities
41
+ Directions: "", t, r, b, l, x, y
42
+ x -> left & right
43
+ y -> top & bottom
44
+ ------------------------- */
45
+
46
+ .generate-mp-scales(@s) when (@s >= 0) {
47
+ .get-space(@s);
48
+
49
+ /* margin */
50
+ .m-@{s} {
51
+ margin: @space-value;
52
+ }
53
+ .m-t-@{s} {
54
+ margin-top: @space-value;
55
+ }
56
+ .m-r-@{s} {
57
+ margin-right: @space-value;
58
+ }
59
+ .m-b-@{s} {
60
+ margin-bottom: @space-value;
61
+ }
62
+ .m-l-@{s} {
63
+ margin-left: @space-value;
64
+ }
65
+ .m-x-@{s} {
66
+ margin-left: @space-value;
67
+ margin-right: @space-value;
68
+ }
69
+ .m-y-@{s} {
70
+ margin-top: @space-value;
71
+ margin-bottom: @space-value;
72
+ }
73
+
74
+ /* padding */
75
+ .p-@{s} {
76
+ padding: @space-value;
77
+ }
78
+ .p-t-@{s} {
79
+ padding-top: @space-value;
80
+ }
81
+ .p-r-@{s} {
82
+ padding-right: @space-value;
83
+ }
84
+ .p-b-@{s} {
85
+ padding-bottom: @space-value;
86
+ }
87
+ .p-l-@{s} {
88
+ padding-left: @space-value;
89
+ }
90
+ .p-x-@{s} {
91
+ padding-left: @space-value;
92
+ padding-right: @space-value;
93
+ }
94
+ .p-y-@{s} {
95
+ padding-top: @space-value;
96
+ padding-bottom: @space-value;
97
+ }
98
+
99
+ .generate-mp-scales(@s - 1);
100
+ }
101
+
102
+ .generate-mp-scales(4); // generates 4..0
103
+
104
+ /* -------------------------
105
+ DISPLAY utilities
106
+ ------------------------- */
107
+ .d-none {
108
+ display: none;
109
+ }
110
+
111
+ .d-block {
112
+ display: block;
113
+ }
114
+
115
+ .d-inline {
116
+ display: inline;
117
+ }
118
+
119
+ .d-inline-block {
120
+ display: inline-block;
121
+ }
122
+
123
+ .d-flex {
124
+ display: flex;
125
+ }
126
+
127
+ .d-inline-flex {
128
+ display: inline-flex;
129
+ }
130
+
131
+ .d-grid {
132
+ display: grid;
133
+ }
134
+
135
+ /* -------------------------
136
+ TEXT ALIGN
137
+ ------------------------- */
138
+ .text-left {
139
+ text-align: left;
140
+ }
141
+
142
+ .text-center {
143
+ text-align: center;
144
+ }
145
+
146
+ .text-right {
147
+ text-align: right;
148
+ }
149
+
150
+ .text-justify {
151
+ text-align: justify;
152
+ }
153
+
154
+ /* -------------------------
155
+ VISIBILITY
156
+ ------------------------- */
157
+ .visible {
158
+ visibility: visible;
159
+ opacity: 1;
160
+ }
161
+
162
+ .invisible {
163
+ visibility: hidden;
164
+ opacity: 0;
165
+ pointer-events: none;
166
+ }
167
+
168
+ /* -------------------------
169
+ FLEX helpers
170
+ ------------------------- */
171
+ .flex {
172
+ display: flex;
173
+ }
174
+
175
+ .flex-row {
176
+ flex-direction: row;
177
+ }
178
+
179
+ .flex-column {
180
+ flex-direction: column;
181
+ }
182
+
183
+ .flex-center {
184
+ display: flex;
185
+ align-items: center;
186
+ justify-content: center;
187
+ }
188
+
189
+ .flex-between {
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: space-between;
193
+ }
194
+
195
+ /* -------------------------
196
+ GRID helpers
197
+ ------------------------- */
198
+ .grid {
199
+ display: grid;
200
+ }
201
+
202
+ .grid-center {
203
+ display: grid;
204
+ place-items: center;
205
+ }
206
+
207
+ /* -------------------------
208
+ WIDTH / HEIGHT utilities
209
+ ------------------------- */
210
+ .w-100 {
211
+ width: 100%;
212
+ }
213
+
214
+ .w-auto {
215
+ width: auto;
216
+ }
217
+
218
+ .h-100 {
219
+ height: 100%;
220
+ }
221
+
222
+ .h-auto {
223
+ height: auto;
224
+ }
225
+
226
+ /* -------------------------
227
+ TEXT TRUNCATE
228
+ ------------------------- */
229
+ .text-truncate {
230
+ overflow: hidden;
231
+ text-overflow: ellipsis;
232
+ white-space: nowrap;
233
+ }
234
+
235
+ /* -------------------------
236
+ TITLES
237
+ ------------------------- */
238
+ .title-h1 {
239
+ font-size: 2rem;
240
+ font-weight: 700;
241
+ }
242
+
243
+ .title-h2 {
244
+ font-size: 1.6rem;
245
+ font-weight: 700;
246
+ }
247
+
248
+ .title-h3 {
249
+ font-size: 1.375rem;
250
+ font-weight: 700;
251
+ }
252
+
253
+ .title-h4 {
254
+ font-size: 1.125rem;
255
+ font-weight: 700;
256
+ }
257
+
258
+ .title-h5 {
259
+ font-size: 1rem;
260
+ font-weight: 700;
261
+ }
262
+
263
+ .title-h6 {
264
+ font-size: .875rem;
265
+ font-weight: 700;
266
+ }
267
+
268
+ /* -------------------------
269
+ TEXT COLORS (CSS variables kept)
270
+ ------------------------- */
271
+ .brand-50 {
272
+ color: var(--brand-50);
273
+ }
274
+
275
+ .brand-100 {
276
+ color: var(--brand-100);
277
+ }
278
+
279
+ .brand-500 {
280
+ color: var(--brand-500);
281
+ }
282
+
283
+ .brand-600 {
284
+ color: var(--brand-600);
285
+ }
286
+
287
+ .brand-700 {
288
+ color: var(--brand-700);
289
+ }
290
+
291
+ .slate-50 {
292
+ color: var(--slate-50);
293
+ }
294
+
295
+ .slate-100 {
296
+ color: var(--slate-100);
297
+ }
298
+
299
+ .slate-200 {
300
+ color: var(--slate-200);
301
+ }
302
+
303
+ .slate-300 {
304
+ color: var(--slate-300);
305
+ }
306
+
307
+ .slate-400 {
308
+ color: var(--slate-400);
309
+ }
310
+
311
+ .slate-500 {
312
+ color: var(--slate-500);
313
+ }
314
+
315
+ .slate-900 {
316
+ color: var(--slate-900);
317
+ }
318
+
319
+ .color-success {
320
+ color: var(--success);
321
+ }
322
+
323
+ .color-warning {
324
+ color: var(--warning);
325
+ }
326
+
327
+ .color-error {
328
+ color: var(--error);
329
+ }
330
+
331
+ .color-info {
332
+ color: var(--info);
333
+ }
334
+
335
+ /* -------------------------
336
+ BACKGROUND COLORS
337
+ ------------------------- */
338
+ .bg-brand-50 {
339
+ background-color: var(--brand-50);
340
+ }
341
+
342
+ .bg-brand-100 {
343
+ background-color: var(--brand-100);
344
+ }
345
+
346
+ .bg-brand-500 {
347
+ background-color: var(--brand-500);
348
+ }
349
+
350
+ .bg-brand-600 {
351
+ background-color: var(--brand-600);
352
+ }
353
+
354
+ .bg-brand-700 {
355
+ background-color: var(--brand-700);
356
+ }
357
+
358
+ .bg-slate-50 {
359
+ background-color: var(--slate-50);
360
+ }
361
+
362
+ .bg-slate-100 {
363
+ background-color: var(--slate-100);
364
+ }
365
+
366
+ .bg-slate-200 {
367
+ background-color: var(--slate-200);
368
+ }
369
+
370
+ .bg-slate-300 {
371
+ background-color: var(--slate-300);
372
+ }
373
+
374
+ .bg-slate-400 {
375
+ background-color: var(--slate-400);
376
+ }
377
+
378
+ .bg-slate-500 {
379
+ background-color: var(--slate-500);
380
+ }
381
+
382
+ .bg-slate-900 {
383
+ background-color: var(--slate-900);
384
+ }
385
+
386
+ .bg-success {
387
+ background-color: var(--success);
388
+ }
389
+
390
+ .bg-warning {
391
+ background-color: var(--warning);
392
+ }
393
+
394
+ .bg-error {
395
+ background-color: var(--error);
396
+ }
397
+
398
+ .bg-info {
399
+ background-color: var(--info);
400
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@razerspine/pug-ui-kit",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Shared Pug mixins for Webpack Starter templates",
5
5
  "keywords": [
6
6
  "pug",
@@ -10,11 +10,15 @@
10
10
  "main": "index.js",
11
11
  "files": [
12
12
  "mixins",
13
+ "scss",
14
+ "less",
13
15
  "index.js",
14
16
  "README.md",
15
17
  "LICENSE",
16
18
  "CHANGELOG.md"
17
19
  ],
20
+ "style": "scss/ui-kit.scss",
21
+ "less": "less/ui-kit.less",
18
22
  "author": "Razerspine",
19
23
  "repository": {
20
24
  "type": "git",
@@ -0,0 +1,44 @@
1
+ @font-face {
2
+ font-family: 'Roboto';
3
+ src: url('../../../fonts/Roboto-Thin.woff2') format('woff2'),
4
+ url('../../../fonts/Roboto-Thin.woff') format('woff');
5
+ font-weight: 100;
6
+ font-style: normal;
7
+ font-display: swap;
8
+ }
9
+
10
+ @font-face {
11
+ font-family: 'Roboto';
12
+ src: url('../../../fonts/Roboto-Light.woff2') format('woff2'),
13
+ url('../../../fonts/Roboto-Light.woff') format('woff');
14
+ font-weight: 300;
15
+ font-style: normal;
16
+ font-display: swap;
17
+ }
18
+
19
+ @font-face {
20
+ font-family: 'Roboto';
21
+ src: url('../../../fonts/Roboto-Regular.woff2') format('woff2'),
22
+ url('../../../fonts/Roboto-Regular.woff') format('woff');
23
+ font-weight: 400;
24
+ font-style: normal;
25
+ font-display: swap;
26
+ }
27
+
28
+ @font-face {
29
+ font-family: 'Roboto';
30
+ src: url('../../../fonts/Roboto-Medium.woff2') format('woff2'),
31
+ url('../../../fonts/Roboto-Medium.woff') format('woff');
32
+ font-weight: 500;
33
+ font-style: normal;
34
+ font-display: swap;
35
+ }
36
+
37
+ @font-face {
38
+ font-family: 'Roboto';
39
+ src: url('../../../fonts/Roboto-Bold.woff2') format('woff2'),
40
+ url("../../../fonts/Roboto-Bold.woff") format('woff');
41
+ font-weight: 700;
42
+ font-style: normal;
43
+ font-display: swap;
44
+ }
@@ -0,0 +1,2 @@
1
+ @forward 'reset';
2
+ @forward 'fonts';
@@ -0,0 +1,155 @@
1
+ @use '../settings/index' as *;
2
+ // Classic CSS reset adapted to SCSS
3
+ // Based on Meyer reset + sensible defaults (box-sizing, media, form elements)
4
+
5
+ /* Box sizing */
6
+ *, *::before, *::after {
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ /* Remove default margin/padding and set core defaults */
11
+ html, body, div, span, applet, object, iframe,
12
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
13
+ a, abbr, acronym, address, big, cite, code,
14
+ del, dfn, em, img, ins, kbd, q, s, samp,
15
+ small, strike, strong, sub, sup, tt, var,
16
+ b, u, i, center,
17
+ dl, dt, dd, ol, ul, li,
18
+ fieldset, form, label, legend,
19
+ table, caption, tbody, tfoot, thead, tr, th, td,
20
+ article, aside, canvas, details, embed,
21
+ figure, figcaption, footer, header, hgroup,
22
+ menu, nav, output, ruby, section, summary,
23
+ time, mark, audio, video {
24
+ margin: 0;
25
+ padding: 0;
26
+ border: 0;
27
+ vertical-align: baseline;
28
+ background: transparent;
29
+ font: inherit;
30
+ color: inherit;
31
+ }
32
+
33
+ /* HTML5 display-role reset for older browsers */
34
+ article, aside, details, figcaption, figure,
35
+ footer, header, hgroup, menu, nav, section {
36
+ display: block;
37
+ }
38
+
39
+ /* Base html/body */
40
+ html {
41
+ line-height: 1.15; /* better default line-height */
42
+ -webkit-text-size-adjust: 100%;
43
+ -ms-text-size-adjust: 100%;
44
+ -ms-overflow-style: scrollbar;
45
+ }
46
+
47
+ body {
48
+ width: 100%;
49
+ min-height: 100dvh;
50
+ text-rendering: optimizeLegibility;
51
+ -webkit-font-smoothing: antialiased;
52
+ -moz-osx-font-smoothing: grayscale;
53
+ }
54
+
55
+ /* Remove list styles */
56
+ ol, ul {
57
+ list-style: none;
58
+ }
59
+
60
+ /* Remove default quotes */
61
+ blockquote, q {
62
+ quotes: none;
63
+ }
64
+
65
+ blockquote::before, blockquote::after,
66
+ q::before, q::after {
67
+ content: none;
68
+ }
69
+
70
+ /* Tables */
71
+ table {
72
+ border-collapse: collapse;
73
+ border-spacing: 0;
74
+ }
75
+
76
+ /* Images and media */
77
+ img, picture, video, canvas, svg {
78
+ display: block;
79
+ max-width: 100%;
80
+ height: auto;
81
+ }
82
+
83
+ /* Links */
84
+ a {
85
+ background-color: transparent;
86
+ text-decoration: none;
87
+ color: inherit;
88
+ }
89
+
90
+ /* Forms: inputs, buttons, selects, textareas */
91
+ input, button, textarea, select {
92
+ font: inherit;
93
+ color: inherit;
94
+ background: transparent;
95
+ border: none;
96
+ outline: none;
97
+ -webkit-appearance: none;
98
+ -moz-appearance: none;
99
+ appearance: none;
100
+ box-shadow: none;
101
+ resize: vertical;
102
+ }
103
+
104
+ /* Buttons and clickable elements */
105
+ button, [type="button"], [type="submit"], [role="button"] {
106
+ cursor: pointer;
107
+ background: none;
108
+ border: none;
109
+ padding: 0;
110
+ }
111
+
112
+ /* Remove inner focus border in Firefox */
113
+ button::-moz-focus-inner {
114
+ border: 0;
115
+ padding: 0;
116
+ }
117
+
118
+ /* Fieldset and legend */
119
+ fieldset {
120
+ margin: 0;
121
+ padding: 0;
122
+ border: 0;
123
+ }
124
+
125
+ legend {
126
+ padding: 0;
127
+ }
128
+
129
+ /* Accessibility helpers */
130
+ [hidden] {
131
+ display: none !important;
132
+ }
133
+
134
+ /* Reduce motion for users who prefer it */
135
+ @media (prefers-reduced-motion: reduce) {
136
+ *, *::before, *::after {
137
+ animation-duration: 0.001ms !important;
138
+ animation-iteration-count: 1 !important;
139
+ transition-duration: 0.001ms !important;
140
+ scroll-behavior: auto !important;
141
+ }
142
+ }
143
+
144
+ /* Utility: make images and media non-draggable by default */
145
+ img, svg, video {
146
+ user-select: none;
147
+ -webkit-user-drag: none;
148
+ -webkit-user-select: none;
149
+ }
150
+
151
+ ///* Optional: set base focus outline for keyboard users (can be customized) */
152
+ //:focus {
153
+ // outline: 2px solid rgba(13, 110, 253, 0.6);
154
+ // outline-offset: 2px;
155
+ //}
@@ -0,0 +1,47 @@
1
+ @use '../settings/index' as *;
2
+
3
+ .aside {
4
+ grid-area: aside;
5
+ display: flex;
6
+ justify-content: flex-start;
7
+ padding: 0 $gutter;
8
+ @media screen and (min-width: map-get($breakpoints, lg)) {
9
+ padding: 0;
10
+ }
11
+ }
12
+
13
+ .navigation {
14
+ background: var(--bg-surface);
15
+ box-shadow: var(--shadow-outline);
16
+ border-radius: $border-radius;
17
+ padding: $gutter;
18
+ width: 100%;
19
+ @media screen and (min-width: map-get($breakpoints, lg)) {
20
+ padding: calc($gutter * 2);
21
+ }
22
+ }
23
+
24
+ .list {
25
+ display: flex;
26
+ flex-direction: column;
27
+ align-items: flex-start;
28
+ justify-content: flex-start;
29
+ width: 100%;
30
+
31
+ &__item {
32
+ width: 100%;
33
+
34
+ &:hover {
35
+ .list__link {
36
+ color: var(--brand-600);
37
+ }
38
+ }
39
+ }
40
+
41
+ &__link {
42
+ color: var(--text-primary);
43
+ display: block;
44
+ width: 100%;
45
+ padding: .375rem .625rem;
46
+ }
47
+ }