nk_jtb 0.14.1 → 0.14.3
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 +1 -2
- package/src/base/_base.scss +0 -40
- package/src/components/_accordion.scss +1 -1
- package/src/jtb.scss +3 -1
- package/src/play.scss +10 -11
- package/src/utilities/_border.scss +0 -5
- package/src/utilities/_typography.scss +3 -3
- package/src/v1/base/_base.scss +30 -0
- package/src/v1/base/index.scss +1 -0
- package/src/v1/utilities/_border.scss +10 -0
- package/src/v1/utilities/_typography.scss +40 -0
- package/src/variables/_base.scss +1 -1
- package/src/variables/_utility_maps.scss +0 -4
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.14.
|
|
4
|
+
"version": "0.14.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/naykel76/nk_jtb.git"
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"jtb": "sass --watch --no-source-map ./src/jtb.scss:dist/css/jtb.css",
|
|
15
15
|
"play": "sass --watch --no-source-map ./src/play.scss:dist/css/play.css",
|
|
16
16
|
"dev": "vite --open",
|
|
17
|
-
"build:jtb": "sass --style compressed --no-source-map ./src/jtb.scss:dist/jtb.min.css",
|
|
18
17
|
"build": "vite build && npm run build:jtb && npm run build:jtb_basic",
|
|
19
18
|
"preview": "vite preview"
|
|
20
19
|
},
|
package/src/base/_base.scss
CHANGED
|
@@ -1,46 +1,6 @@
|
|
|
1
|
-
// @use '../variables' as *;
|
|
2
1
|
@use '../v1/maps_and_variables/base' as *;
|
|
3
|
-
|
|
4
2
|
@use 'sass:list';
|
|
5
3
|
|
|
6
|
-
* {
|
|
7
|
-
margin: 0; // 1.
|
|
8
|
-
padding: 0; // 1.
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
|
12
|
-
// 2. Allow adding a border to an element by just adding a border-width.
|
|
13
|
-
|
|
14
|
-
*,
|
|
15
|
-
::before,
|
|
16
|
-
::after {
|
|
17
|
-
box-sizing: border-box; // 1
|
|
18
|
-
border-width: 0; // 2
|
|
19
|
-
border-style: solid; // 2
|
|
20
|
-
border-color: $border-color; // 2
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// 1. Use a consistent sensible line-height in all browsers.
|
|
24
|
-
// 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
25
|
-
// 3. Use a more readable tab size.
|
|
26
|
-
|
|
27
|
-
html {
|
|
28
|
-
line-height: $line-height; // 1
|
|
29
|
-
-webkit-text-size-adjust: 100%; // 2
|
|
30
|
-
-moz-tab-size: 4; // 3
|
|
31
|
-
tab-size: 4; // 3
|
|
32
|
-
font-family: $font-family;
|
|
33
|
-
font-size: $font-size;
|
|
34
|
-
scroll-behavior: smooth;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// 1. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
|
|
38
|
-
|
|
39
|
-
body {
|
|
40
|
-
line-height: inherit; // 1
|
|
41
|
-
color: $text-color;
|
|
42
|
-
background-color: $body-bg;
|
|
43
|
-
}
|
|
44
4
|
|
|
45
5
|
hr {
|
|
46
6
|
height: 0;
|
package/src/jtb.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
@use './base';
|
|
1
|
+
@use './base' as oldBase;
|
|
2
|
+
@use './v1/base';
|
|
2
3
|
|
|
3
4
|
// -- ORDER MATTERS --
|
|
4
5
|
// ----------------------------------------------------------------
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
@forward './utilities/transition';
|
|
43
44
|
@forward './utilities/typography';
|
|
44
45
|
@forward './v1/utilities/backgrounds';
|
|
46
|
+
@forward './v1/utilities/border';
|
|
45
47
|
@forward './v1/utilities/typography';
|
|
46
48
|
|
|
47
49
|
// extras
|
package/src/play.scss
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
// @use './utilities/typography' as *;
|
|
2
|
+
@use './v1/maps_and_variables/base' as *;
|
|
3
|
+
@use './v1/maps_and_variables/colors' as *;
|
|
4
|
+
@use './v1/maps_and_variables/tailwind-colors' as *;
|
|
2
5
|
@use 'sass:color';
|
|
3
6
|
@use 'sass:list';
|
|
4
7
|
@use 'sass:map';
|
|
5
8
|
@use 'sass:string';
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
color: $color;
|
|
15
|
-
}
|
|
16
|
-
.bg-darken {
|
|
17
|
-
background-color: $darken;
|
|
10
|
+
// NK::TD Update to use build tools including responsive breakpoints
|
|
11
|
+
@each $color-name, $color-map in $tailwind-colors {
|
|
12
|
+
@each $key, $value in $color-map {
|
|
13
|
+
.bdr-#{$color-name}-#{$key} {
|
|
14
|
+
border-color: $value;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
18
17
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@use 'sass:map';
|
|
4
4
|
|
|
5
5
|
// remove the following colours from the map
|
|
6
|
-
$border-colors-merged: magic-merge($border-colors, $border-color-variants);
|
|
7
6
|
$border-radius-merged: magic-merge($border-radius-variants, $border-radius-sizes);
|
|
8
7
|
|
|
9
8
|
// this is not easy to override on the child element unless the
|
|
@@ -32,10 +31,6 @@ $border-properties-map: (
|
|
|
32
31
|
prefix: #{$border-identifier},
|
|
33
32
|
values: (solid, dashed, dotted, double, none),
|
|
34
33
|
),
|
|
35
|
-
border-color: (
|
|
36
|
-
prefix: #{$border-identifier},
|
|
37
|
-
values: $border-colors-merged
|
|
38
|
-
),
|
|
39
34
|
border-radius: (
|
|
40
35
|
prefix: "rounded-",
|
|
41
36
|
values: $border-radius-merged,
|
|
@@ -20,7 +20,7 @@ $text-variant-sizes: (
|
|
|
20
20
|
) !default;
|
|
21
21
|
|
|
22
22
|
// convert 'rem' sizes to map and merge with variant sizes
|
|
23
|
-
$text-
|
|
23
|
+
$text-sizes: map.merge(listToMap($text-rem-sizes), $text-variant-sizes);
|
|
24
24
|
|
|
25
25
|
// ==========================================================================
|
|
26
26
|
// -- OPINIONATED TEXT CLASSES --
|
|
@@ -62,7 +62,7 @@ $text-variants: map.merge(listToMap($text-rem-sizes), $text-variant-sizes);
|
|
|
62
62
|
// This needs to be included in the properties map. I have left seperate for now
|
|
63
63
|
// because 'base' is automatically stripped out
|
|
64
64
|
.txt-base {
|
|
65
|
-
color: $color;
|
|
65
|
+
color: $text-color;
|
|
66
66
|
}
|
|
67
67
|
// ==========================================================================
|
|
68
68
|
// -- UTILITY CLASS MAP --
|
|
@@ -76,7 +76,7 @@ $typography-properties-map: (
|
|
|
76
76
|
),
|
|
77
77
|
font-size: (
|
|
78
78
|
prefix: "#{$text-identifier}",
|
|
79
|
-
values: $text-
|
|
79
|
+
values: $text-sizes,
|
|
80
80
|
// TXT BREAKPOINTS ARE NOT WORKING CORRECTLY WITH THE UNIT
|
|
81
81
|
// breakpoints: ("sm", "md", "lg", "xl"),
|
|
82
82
|
unit: "rem"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@use '../maps_and_variables/base' as *;
|
|
2
|
+
|
|
3
|
+
*,
|
|
4
|
+
::after,
|
|
5
|
+
::before {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
border: 0 solid;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// 1. Prevent font scaling in Safari.
|
|
13
|
+
// 2. Improve tab character spacing in code or pre elements.
|
|
14
|
+
|
|
15
|
+
html {
|
|
16
|
+
line-height: $line-height;
|
|
17
|
+
-webkit-text-size-adjust: 100%; // 1
|
|
18
|
+
tab-size: 4; // 2
|
|
19
|
+
font-family: $font-family;
|
|
20
|
+
font-size: $font-size;
|
|
21
|
+
scroll-behavior: smooth;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Inherit from html to allow setting line-height on html directly.
|
|
25
|
+
|
|
26
|
+
body {
|
|
27
|
+
line-height: inherit;
|
|
28
|
+
color: $text-color;
|
|
29
|
+
background-color: $body-bg;
|
|
30
|
+
}
|
package/src/v1/base/index.scss
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@use '../maps_and_variables/tailwind-colors' as *;
|
|
2
|
+
|
|
3
|
+
// NK::TD Update to use build tools including responsive breakpoints
|
|
4
|
+
@each $color-name, $color-map in $tailwind-colors {
|
|
5
|
+
@each $key, $value in $color-map {
|
|
6
|
+
.bdr-#{$color-name}-#{$key} {
|
|
7
|
+
border-color: $value;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use '../maps_and_variables/tailwind-colors' as *;
|
|
2
|
+
@use 'sass:map';
|
|
2
3
|
|
|
3
4
|
// NK::TD Consider if I really need place holder color utility classes
|
|
4
5
|
|
|
@@ -15,3 +16,42 @@
|
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
}
|
|
19
|
+
|
|
20
|
+
// NK::TD Update to use build tools including responsive breakpoints
|
|
21
|
+
$text-variants: (
|
|
22
|
+
xs: (
|
|
23
|
+
font-size: 0.75rem,
|
|
24
|
+
line-height: 1
|
|
25
|
+
),
|
|
26
|
+
sm: (
|
|
27
|
+
font-size: 0.875rem,
|
|
28
|
+
line-height: 1.25
|
|
29
|
+
),
|
|
30
|
+
base: (
|
|
31
|
+
font-size: 1rem,
|
|
32
|
+
line-height: 1.5
|
|
33
|
+
),
|
|
34
|
+
lg: (
|
|
35
|
+
font-size: 1.125rem,
|
|
36
|
+
line-height: 1.5
|
|
37
|
+
),
|
|
38
|
+
xl: (
|
|
39
|
+
font-size: 1.25rem,
|
|
40
|
+
line-height: 1.5
|
|
41
|
+
),
|
|
42
|
+
xxl: (
|
|
43
|
+
font-size: 1.5rem,
|
|
44
|
+
line-height: 1.5
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
@mixin generate-text-variants($map) {
|
|
49
|
+
@each $name, $props in $map {
|
|
50
|
+
.txt-#{$name} {
|
|
51
|
+
font-size: map.get($props, font-size);
|
|
52
|
+
line-height: map.get($props, line-height);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@include generate-text-variants($text-variants);
|
package/src/variables/_base.scss
CHANGED
|
@@ -60,10 +60,6 @@ $fr-conversion-2-col: (
|
|
|
60
60
|
// ==========================================================================
|
|
61
61
|
// Border, and border-radius sizes
|
|
62
62
|
// ==========================================================================
|
|
63
|
-
$border-color-variants: (
|
|
64
|
-
light: rgba(255, 255, 255, 0.15),
|
|
65
|
-
dark: rgba(0, 0, 0, 0.15)
|
|
66
|
-
) !default;
|
|
67
63
|
$border-colors: map.remove($color-map, 'danger', 'dark', 'info', 'light', 'success', 'warning') !default;
|
|
68
64
|
|
|
69
65
|
$border-radius-sizes: (0, 0.25, 0.5, 0.75, 1, 1.5, 2) !default;
|