nk_jtb 0.4.0 → 0.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nk_jtb",
3
3
  "description": "Yet another utility based framework.",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/naykel76/nk_jtb.git"
@@ -13,14 +13,14 @@
13
13
  "spacing": "sass --watch --no-source-map ./scss/utilities/_spacing.scss:dist/css/spacing.css",
14
14
  "flex": "sass --watch --no-source-map ./scss/utilities/_flex.scss:dist/css/flex.css",
15
15
  "grid": "sass --watch --no-source-map ./scss/utilities/_grid.scss:dist/css/grid.css",
16
- "play": "sass --watch --no-source-map ./scss/_play.scss:dist/css/play.css",
16
+ "play": "sass --watch --no-source-map ./scss/play.scss:dist/css/play.css",
17
17
  "dev": "vite --open",
18
18
  "build": "vite build",
19
19
  "preview": "vite preview"
20
20
  },
21
21
  "devDependencies": {
22
- "sass": "^1.54.0",
23
- "vite": "^3.0.0"
22
+ "sass": "^1.60.0",
23
+ "vite": "^4.2.1"
24
24
  },
25
25
  "dependencies": {
26
26
  "alpinejs": "^3.10.5"
package/scss/_nk.scss CHANGED
@@ -97,3 +97,26 @@ trix-editor {
97
97
  display: none;
98
98
  }
99
99
  }
100
+
101
+
102
+ // ==========================================================================
103
+ // -- Primary banner for page layouts --
104
+ // ==========================================================================
105
+ $banner-height: 450px !default;
106
+ $banner-bg: transparent !default;
107
+ $banner-text-bg: transparent !default;
108
+
109
+ .banner {
110
+ background-repeat: no-repeat;
111
+ background-position: right center;
112
+ height: $banner-height;
113
+ background-color: $banner-bg;
114
+
115
+ // banner-text is the wrapper
116
+ &-text {
117
+ // color: white;
118
+ background-color: $banner-text-bg;
119
+ padding: 1rem;
120
+ }
121
+ }
122
+
@@ -304,25 +304,11 @@ textarea {
304
304
  resize: vertical;
305
305
  }
306
306
 
307
- // 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
308
- // 2. Set the default placeholder color to the user's configured gray 400 color.
309
-
310
- input::-moz-placeholder,
311
- textarea::-moz-placeholder {
312
- opacity: 1; // 1
313
- color: #9ca3af; // 2
314
- }
315
-
316
- input:-ms-input-placeholder,
317
- textarea:-ms-input-placeholder {
318
- opacity: 1; // 1
319
- color: #9ca3af; // 2
320
- }
321
307
 
322
308
  input::placeholder,
323
309
  textarea::placeholder {
324
310
  opacity: 1; // 1
325
- color: #9ca3af; // 2
311
+ color: #c5c5c5; // 2
326
312
  }
327
313
 
328
314
  // Set the default cursor for buttons.
@@ -1,36 +1,103 @@
1
+ @use "../base/vars_base" as *;
2
+ // add accordion component variables here instead of the main
3
+ // component variable file.
1
4
  $accordion-bg: rgb(245, 245, 245) !default;
5
+ $accordion-border: $border !default;
6
+ $accordion-hover-bg: darken($accordion-bg, 5%) !default;
2
7
 
3
- .accordion {
4
- border: 1px solid;
5
- margin-top: 1rem;
6
- }
8
+ $midnight: #2c3e50;
9
+
10
+ // ---------------- BEFORE YOU DO ANYTHING CRAZY ------------------
11
+ // These styles are for the CSS accordion, not the Alpine accordion.
12
+ // You should focus the accordion behaviour and limit opinionated
13
+ // styles to make it easier to apply utility classes.
14
+ // ---------------- BEFORE YOU DO ANYTHING CRAZY ------------------
7
15
 
8
- .accordion-toggle {
9
- background-color: $accordion-bg;
10
- color: #444;
11
- cursor: pointer;
12
- width: 100%;
13
- transition: 0.4s;
14
- border: 1px solid rgba(0, 0, 0, 0.05);
15
- display: flex;
16
- justify-content: space-between;
17
- align-items: center;
18
- padding: 1rem;
16
+ // style the toggle
17
+ :where(.accordion label) {
18
+ font-weight: bold;
19
+ // background: #000;
19
20
  }
20
21
 
21
- // Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover)
22
- .accordion-active,
23
- .accordion-toggle:hover {
24
- background-color: rgb(230, 230, 230);
22
+ .accordion {
23
+ overflow: hidden;
24
+ margin-bottom: 0.5rem;
25
+ border: $border;
26
+
27
+ // title and label are used to toggle the accordion
28
+ &-title,
29
+ label {
30
+ width: 100%;
31
+ transition: 0.3s;
32
+ display: flex;
33
+ justify-content: space-between;
34
+ padding: 1em;
35
+ background: $accordion-bg;
36
+ cursor: pointer;
37
+
38
+ &:hover {
39
+ background: $accordion-hover-bg;
40
+ }
41
+ /* Icon */
42
+ &::after {
43
+ content: "\276F";
44
+ text-align: center;
45
+ transition: all 0.3s;
46
+ }
47
+ }
48
+
49
+ &-content {
50
+ padding: 0 1em;
51
+ max-height: 0;
52
+ transition: all 0.3s;
53
+ }
54
+
55
+ &-close {
56
+ display: flex;
57
+ justify-content: flex-end;
58
+ font-size: 0.75em;
59
+ cursor: pointer;
60
+ }
61
+
62
+ input {
63
+ position: absolute;
64
+ opacity: 0;
65
+ z-index: -1;
66
+ // checked toggles open and closed
67
+ &:checked {
68
+ + label {
69
+ background: $accordion-hover-bg;
70
+ &::after {
71
+ transform: rotate(90deg);
72
+ }
73
+ }
74
+ ~ .accordion-content {
75
+ max-height: 999vh; // prevent cutting off content
76
+ padding: 1em;
77
+ }
78
+ }
79
+ }
80
+
81
+ .active {
82
+ content: "\276F";
83
+ text-align: center;
84
+ transition: all 0.3s;
85
+ &::after {
86
+ transform: rotate(90deg);
87
+ }
88
+ }
25
89
  }
26
90
 
91
+ // ---------------- BEFORE YOU DO ANYTHING CRAZY ------------------
92
+ // This is only used in an alpine accordion and will be DEPRECIATED
93
+ // ---------------- BEFORE YOU DO ANYTHING CRAZY ------------------
94
+
27
95
  .accordion-body {
28
96
  display: block;
29
97
  overflow: hidden;
30
98
  border-radius: 0;
31
99
 
32
100
  > div {
33
- border-top: none;
34
101
  &:hover {
35
102
  background-color: rgba(250, 221, 230, 0.15);
36
103
  }
@@ -3,8 +3,6 @@
3
3
 
4
4
  // @use "../base/vars_base" as *;
5
5
 
6
- $placeholder-color: #bbbbbb !default;
7
-
8
6
  // -- Base Elements --
9
7
  // ==========================================================================
10
8
  label {
@@ -26,12 +24,6 @@ select {
26
24
  cursor: pointer;
27
25
  }
28
26
 
29
- ::placeholder {
30
- color: $placeholder-color;
31
- opacity: 1;
32
- }
33
-
34
- //
35
27
  .checkbox,
36
28
  .radio {
37
29
  cursor: pointer;
@@ -41,6 +33,7 @@ select {
41
33
 
42
34
  // -- frm-row --
43
35
  // ==========================================================================
36
+
44
37
  .frm-row {
45
38
  position: relative;
46
39
  display: flex;
@@ -57,7 +50,11 @@ select {
57
50
  gap: 1rem;
58
51
 
59
52
  label {
60
- width: 10rem; // use flex-basis to override
53
+ // exclude width class to make it easier to override or
54
+ // can also use flex-basis to override width
55
+ &:not([class*="w-"]) {
56
+ width: 10rem;
57
+ }
61
58
  flex-shrink: 0; // prevent shrink for 100%
62
59
  margin-top: 4px; // better alignment
63
60
  }
@@ -98,8 +95,7 @@ select {
98
95
  }
99
96
  }
100
97
 
101
-
102
- .withAddons:has(.leadingAddon){
98
+ .withAddons:has(.leadingAddon) {
103
99
  background: green;
104
100
  }
105
101
  // the width of the addon will vary depending on the content
@@ -12,7 +12,9 @@ $toggle-gap: 0.25rem;
12
12
  cursor: pointer;
13
13
 
14
14
  input[type="checkbox"] {
15
- @extend .sr-only;
15
+ height: 0;
16
+ width: 0;
17
+ visibility: hidden;
16
18
  }
17
19
 
18
20
  // toggle body
@@ -29,7 +31,8 @@ $toggle-gap: 0.25rem;
29
31
  height: calc($toggle-body-height - $toggle-gap);
30
32
  width: calc($toggle-body-height - $toggle-gap);
31
33
  top: calc($toggle-gap / 2);
32
- left: calc($toggle-gap / 2);
34
+ left: calc($toggle-gap + $toggle-gap / 2);
35
+ // left: calc($toggle-gap + .1125rem);
33
36
  background-color: hsl(0, 0%, 100%);
34
37
  border-color: rgba(0, 0, 0, 0.15);
35
38
  border-radius: 9999px;
@@ -37,18 +40,18 @@ $toggle-gap: 0.25rem;
37
40
  @extend .transition;
38
41
  }
39
42
  }
40
- }
41
43
 
42
- input[type="checkbox"]:checked {
43
- // toggle body on (checked)
44
- ~ div {
45
- background-color: hsl(100, 70%, 40%);
46
- @extend .transition;
47
- // toggle when checked
48
- &::after {
49
- // background-color: hsl(50, 10%, 10%);
50
- transform: translateX(calc($toggle-body-width - $toggle-body-height));
44
+ input[type="checkbox"]:checked {
45
+ // toggle body on (checked)
46
+ ~ div {
47
+ background-color: hsl(100, 70%, 40%);
51
48
  @extend .transition;
49
+ // toggle when checked
50
+ &::after {
51
+ // background-color: hsl(50, 10%, 10%);
52
+ transform: translateX(calc($toggle-body-width - $toggle-body-height));
53
+ @extend .transition;
54
+ }
52
55
  }
53
56
  }
54
57
  }
package/scss/play.scss CHANGED
@@ -1,30 +1,76 @@
1
- @use "./base/vars_all" as *;
2
- @use "./base/vars_base" as *;
3
- @use "./base/vars_utility_maps" as *;
4
- @use "./functions/helpers" as *;
5
- @use "./mixins/makeCssPropertyMixins" as *;
6
- @use "./mixins/makeMagicClass" as *;
7
- @use "./mixins/makeMagicGrid2Cols" as *;
8
- @use "./mixins/media" as *;
9
- @use "./mixins/positionUtilityClasses" as *;
10
- @use "sass:list";
11
- @use "sass:map";
12
- @use "sass:string";
1
+ // @use "./base/vars_all" as *;
2
+ // @use "./base/vars_base" as *;
3
+ // @use "./base/vars_utility_maps" as *;
4
+ // @use "./functions/helpers" as *;
5
+ // @use "./mixins/makeCssPropertyMixins" as *;
6
+ // @use "./mixins/makeMagicClass" as *;
7
+ // @use "./mixins/makeMagicGrid2Cols" as *;
8
+ // @use "./mixins/media" as *;
9
+ // @use "./mixins/positionUtilityClasses" as *;
10
+ // @use "sass:list";
11
+ // @use "sass:map";
12
+ // @use "sass:string";
13
+ // add accordion component variables here instead of the main
13
14
 
14
- $magic-width-sizes: ((16, "full"), (24, "full")) !default;
15
- @include makeMagicClass("width", "w", ($magic-width-sizes));
16
15
 
17
- // $magic-grid-sizes-2cols: ((25, 25), (25, 25));
18
- // @include makeMagicGrid2Cols($magic-grid-sizes-2cols);
16
+ // $midnight: #2c3e50;
17
+ // .accordion {
18
+ // color: white;
19
+ // overflow: hidden;
20
+ // label {
21
+ // display: flex;
22
+ // justify-content: space-between;
23
+ // padding: 1em;
24
+ // background: $midnight;
25
+ // font-weight: bold;
26
+ // cursor: pointer;
27
+ // /* Icon */
28
+ // &:hover {
29
+ // background: darken($midnight, 10%);
30
+ // }
31
+ // &::after {
32
+ // content: "\276F";
33
+ // width: 1em;
34
+ // height: 1em;
35
+ // text-align: center;
36
+ // transition: all 0.35s;
37
+ // }
38
+ // }
39
+ // &-content {
40
+ // max-height: 0;
41
+ // padding: 0 1em;
42
+ // color: $midnight;
43
+ // background: white;
44
+ // transition: all 0.35s;
45
+ // }
46
+ // &-close {
47
+ // display: flex;
48
+ // justify-content: flex-end;
49
+ // padding: 1em;
50
+ // font-size: 0.75em;
51
+ // background: $midnight;
52
+ // cursor: pointer;
53
+ // &:hover {
54
+ // background: darken($midnight, 10%);
55
+ // }
56
+ // }
19
57
 
20
- // (sfw) single fixed width
21
- @media (min-width: 576px) {
22
- .cols-sfw-25_25 {
23
- grid-template-columns: 1fr 14rem;
24
- }
25
- }
26
- @media (min-width: 768px) {
27
- .cols-sfw-25_25 {
28
- grid-template-columns: 1fr 20rem;
29
- }
30
- }
58
+ // input {
59
+ // position: absolute;
60
+ // opacity: 0;
61
+ // z-index: -1;
62
+ // // checked toggles open and closed
63
+ // &:checked {
64
+ // + label {
65
+ // background: darken($midnight, 10%);
66
+ // &::after {
67
+ // transform: rotate(90deg);
68
+ // }
69
+ // }
70
+ // ~ .accordion-content {
71
+ // max-height: 100vh;
72
+ // padding: 1em;
73
+ // }
74
+ // }
75
+ // }
76
+ // }
@@ -42,8 +42,8 @@ $visibility-utilities: (
42
42
  .sr-only {
43
43
  opacity: 0;
44
44
  position: absolute;
45
- left: -9000px;
46
- top: -9000px;
45
+ // left: -9000px;
46
+ // top: -9000px;
47
47
  }
48
48
 
49
49
  // |--\0/-- DISPLAY --\0/--|
@@ -65,7 +65,7 @@ $grid-gap-magic-sizes: ((5, 3, 2), (5, 3), (4, 2), (3, 1)) !default;
65
65
  // --------------------------------------------------------------------------
66
66
 
67
67
  // currently starts at md, (anything under is final size) . not convinced I need to go smaller
68
- $fixed-width-columns-map: ((4, 2, 1), (3, 2, 1), (2, 1)) !default;
68
+ $fixed-width-columns-map: ((4, 2, 1), (3, 2, 1), (3, 1, 1), (2, 1)) !default;
69
69
  @include makeMagicGridFixedWidth($fixed-width-columns-map);
70
70
 
71
71
  // --------------------------------------------------------------------------
@@ -18,6 +18,10 @@
18
18
  .z-100 {
19
19
  z-index: 100;
20
20
  }
21
+
22
+ .z-top {
23
+ z-index: 999;
24
+ }
21
25
  // ==========================================================================
22
26
  // Element Position
23
27
  // ==========================================================================