@kaizen/tailwind 0.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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/tailwind-presets.d.ts +8 -0
- package/dist/tailwind-presets.d.ts.map +1 -0
- package/dist/tailwind-presets.js +138 -0
- package/dist/tailwind-presets.js.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +1 -0
- package/src/tailwind-presets.ts +135 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 0.1.0 (2022-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add tailwind beta release ([#3136](https://github.com/cultureamp/kaizen-design-system/issues/3136)) ([cacff22](https://github.com/cultureamp/kaizen-design-system/commit/cacff220e18ebdc6c2e24f28d5e363ad0ae3bc31)), closes [#3116](https://github.com/cultureamp/kaizen-design-system/issues/3116) [#3121](https://github.com/cultureamp/kaizen-design-system/issues/3121)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Culture Amp Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./tailwind-presets"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ThemeConfig } from "tailwindcss/types/config";
|
|
2
|
+
export type KaizenTailwindTheme = Partial<ThemeConfig>;
|
|
3
|
+
export interface KaizenTailwindPreset {
|
|
4
|
+
theme: KaizenTailwindTheme;
|
|
5
|
+
}
|
|
6
|
+
export declare const kaizenTailwindTheme: KaizenTailwindTheme;
|
|
7
|
+
export declare const Preset: KaizenTailwindPreset;
|
|
8
|
+
//# sourceMappingURL=tailwind-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind-presets.d.ts","sourceRoot":"","sources":["../src/tailwind-presets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAItD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACtD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,mBAAmB,CAAA;CAC3B;AAGD,eAAO,MAAM,mBAAmB,EAAE,mBAuHjC,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,oBAEpB,CAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Preset = exports.kaizenTailwindTheme = void 0;
|
|
38
|
+
var twDefaultTheme = __importStar(require("tailwindcss/defaultTheme"));
|
|
39
|
+
var design_tokens_1 = require("@kaizen/design-tokens");
|
|
40
|
+
// Note: changing any token will require to to run build:ts from the root `design-tokens`
|
|
41
|
+
exports.kaizenTailwindTheme = {
|
|
42
|
+
colors: __assign(__assign({ transparent: "transparent", current: "currentColor", inherit: "inherit" }, design_tokens_1.defaultTheme.color), design_tokens_1.defaultTheme.dataViz),
|
|
43
|
+
spacing: __assign(__assign({}, design_tokens_1.defaultTheme.spacing), twDefaultTheme.spacing),
|
|
44
|
+
boxShadow: {
|
|
45
|
+
none: "none",
|
|
46
|
+
sm: design_tokens_1.defaultTheme.shadow.small.boxShadow,
|
|
47
|
+
lg: design_tokens_1.defaultTheme.shadow.large.boxShadow,
|
|
48
|
+
},
|
|
49
|
+
borderRadius: {
|
|
50
|
+
none: "0px",
|
|
51
|
+
default: "7px",
|
|
52
|
+
"focus-ring": "10px",
|
|
53
|
+
full: "100%",
|
|
54
|
+
},
|
|
55
|
+
borderWidth: {
|
|
56
|
+
"width-none": "0px",
|
|
57
|
+
"width-default": "2px",
|
|
58
|
+
"width-focus-ring": "2px",
|
|
59
|
+
},
|
|
60
|
+
// how do we want to handle our focus rings?
|
|
61
|
+
// tailwind used a `ring` property
|
|
62
|
+
borderColor: __assign({ "color-solid": "".concat(design_tokens_1.defaultTheme.border.solid.borderColor), "color-transparent": "".concat(design_tokens_1.defaultTheme.border.borderless.borderColor), "color-focus-ring": design_tokens_1.defaultTheme.color.blue[600] }, design_tokens_1.defaultTheme.color),
|
|
63
|
+
fontFamily: {
|
|
64
|
+
"family-paragraph": ["".concat(design_tokens_1.defaultTheme.typography.paragraphBody.fontFamily)],
|
|
65
|
+
"family-heading": ["".concat(design_tokens_1.defaultTheme.typography.heading1.fontFamily)],
|
|
66
|
+
"family-data": ["".concat(design_tokens_1.defaultTheme.typography.dataLarge.fontFamily)],
|
|
67
|
+
"family-display": ["".concat(design_tokens_1.defaultTheme.typography.display0.fontFamily)],
|
|
68
|
+
},
|
|
69
|
+
fontSize: {
|
|
70
|
+
"size-display": "".concat(design_tokens_1.defaultTheme.typography.display0.fontSize),
|
|
71
|
+
"size-heading-1": "".concat(design_tokens_1.defaultTheme.typography.heading1.fontSize),
|
|
72
|
+
"size-heading-2": "".concat(design_tokens_1.defaultTheme.typography.heading2.fontSize),
|
|
73
|
+
"size-heading-3": "".concat(design_tokens_1.defaultTheme.typography.heading3.fontSize),
|
|
74
|
+
"size-heading-4": "".concat(design_tokens_1.defaultTheme.typography.heading4.fontSize),
|
|
75
|
+
"size-heading-5": "".concat(design_tokens_1.defaultTheme.typography.heading5.fontSize),
|
|
76
|
+
"size-heading-6": "".concat(design_tokens_1.defaultTheme.typography.heading6.fontSize),
|
|
77
|
+
"size-paragraph": "".concat(design_tokens_1.defaultTheme.typography.paragraphBody.fontSize),
|
|
78
|
+
"size-paragraph-lede": "".concat(design_tokens_1.defaultTheme.typography.paragraphIntroLede.fontSize),
|
|
79
|
+
"size-paragraph-sm": "".concat(design_tokens_1.defaultTheme.typography.paragraphSmall.fontSize),
|
|
80
|
+
"size-paragraph-xs": "".concat(design_tokens_1.defaultTheme.typography.paragraphExtraSmall.fontSize),
|
|
81
|
+
"size-data-lg": "".concat(design_tokens_1.defaultTheme.typography.dataLarge.fontSize),
|
|
82
|
+
"size-data-md": "".concat(design_tokens_1.defaultTheme.typography.dataMedium.fontSize),
|
|
83
|
+
"size-data-sm": "".concat(design_tokens_1.defaultTheme.typography.dataSmall.fontSize),
|
|
84
|
+
"size-data-units-lg": "".concat(design_tokens_1.defaultTheme.typography.dataLargeUnits.fontSize),
|
|
85
|
+
"size-data-units-md": "".concat(design_tokens_1.defaultTheme.typography.dataMediumUnits.fontSize),
|
|
86
|
+
"size-data-units-sm": "".concat(design_tokens_1.defaultTheme.typography.dataSmallUnits.fontSize),
|
|
87
|
+
},
|
|
88
|
+
// font weights could have specific tokens (current don't)
|
|
89
|
+
fontWeight: {
|
|
90
|
+
"weight-paragraph": "400",
|
|
91
|
+
"weight-paragraph-bold": "600",
|
|
92
|
+
"weight-data": "700",
|
|
93
|
+
"weight-heading": "700",
|
|
94
|
+
"weight-display": "800",
|
|
95
|
+
"weight-normal": "400",
|
|
96
|
+
"weight-medium": "500",
|
|
97
|
+
"weight-semibold": "600",
|
|
98
|
+
"weight-bold": "700",
|
|
99
|
+
"weight-extrabold": "800",
|
|
100
|
+
},
|
|
101
|
+
lineHeight: {
|
|
102
|
+
"height-display": "".concat(design_tokens_1.defaultTheme.typography.display0.lineHeight),
|
|
103
|
+
"height-heading-1": "".concat(design_tokens_1.defaultTheme.typography.heading1.lineHeight),
|
|
104
|
+
"height-heading-2": "".concat(design_tokens_1.defaultTheme.typography.heading2.lineHeight),
|
|
105
|
+
"height-heading-3": "".concat(design_tokens_1.defaultTheme.typography.heading3.lineHeight),
|
|
106
|
+
"height-heading-4": "".concat(design_tokens_1.defaultTheme.typography.heading4.lineHeight),
|
|
107
|
+
"height-heading-5": "".concat(design_tokens_1.defaultTheme.typography.heading5.lineHeight),
|
|
108
|
+
"height-heading-6": "".concat(design_tokens_1.defaultTheme.typography.heading6.lineHeight),
|
|
109
|
+
"height-paragraph": "".concat(design_tokens_1.defaultTheme.typography.paragraphBody.lineHeight),
|
|
110
|
+
"height-paragraph-lede": "".concat(design_tokens_1.defaultTheme.typography.paragraphIntroLede.lineHeight),
|
|
111
|
+
"height-paragraph-sm": "".concat(design_tokens_1.defaultTheme.typography.paragraphSmall.lineHeight),
|
|
112
|
+
"height-paragraph-xs": "".concat(design_tokens_1.defaultTheme.typography.paragraphExtraSmall.lineHeight),
|
|
113
|
+
"height-data-lg": "".concat(design_tokens_1.defaultTheme.typography.dataLarge.lineHeight),
|
|
114
|
+
"height-data-md": "".concat(design_tokens_1.defaultTheme.typography.dataMedium.lineHeight),
|
|
115
|
+
"height-data-sm": "".concat(design_tokens_1.defaultTheme.typography.dataSmall.lineHeight),
|
|
116
|
+
"height-data-units-lg": "".concat(design_tokens_1.defaultTheme.typography.dataLargeUnits.lineHeight),
|
|
117
|
+
"height-data-units-md": "".concat(design_tokens_1.defaultTheme.typography.dataMediumUnits.lineHeight),
|
|
118
|
+
"height-data-units-sm": "".concat(design_tokens_1.defaultTheme.typography.dataSmallUnits.lineHeight),
|
|
119
|
+
},
|
|
120
|
+
letterSpacing: {
|
|
121
|
+
"spacing-normal": "normal",
|
|
122
|
+
},
|
|
123
|
+
// A mix of layout styles
|
|
124
|
+
maxWidth: __assign(__assign({}, twDefaultTheme.maxWidth), { content: design_tokens_1.defaultTheme.layout.contentMaxWidth, "content-with-side": design_tokens_1.defaultTheme.layout.contentMaxWidthWithSidebar }),
|
|
125
|
+
width: __assign(__assign({}, twDefaultTheme.width), { "content-side-margin": design_tokens_1.defaultTheme.layout.contentSideMargin }),
|
|
126
|
+
height: __assign(__assign({}, twDefaultTheme.height), { "mobile-actions-drawer-height": design_tokens_1.defaultTheme.layout.mobileActionsDrawerHeight, "navigation-bar-height": design_tokens_1.defaultTheme.layout.navigationBarHeight }),
|
|
127
|
+
// we will probably want to review viewport sizing
|
|
128
|
+
screens: {
|
|
129
|
+
"media-min-md": design_tokens_1.defaultTheme.layout.breakpoints.medium,
|
|
130
|
+
"media-min-lg": design_tokens_1.defaultTheme.layout.breakpoints.large,
|
|
131
|
+
"media-max-md": { max: design_tokens_1.defaultTheme.layout.breakpoints.medium },
|
|
132
|
+
"media-max-lg": { max: design_tokens_1.defaultTheme.layout.breakpoints.large }, // => @media (min-width: 1080px) { ... }
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
exports.Preset = {
|
|
136
|
+
theme: exports.kaizenTailwindTheme,
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=tailwind-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind-presets.js","sourceRoot":"","sources":["../src/tailwind-presets.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAA0D;AAG1D,uDAAoD;AAOpD,yFAAyF;AAC5E,QAAA,mBAAmB,GAAwB;IACtD,MAAM,sBACJ,WAAW,EAAE,aAAa,EAC1B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,SAAS,IACf,4BAAY,CAAC,KAAK,GAClB,4BAAY,CAAC,OA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GAAyB;IAC1C,KAAK,EAAE,2BAAmB;CAC3B,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kaizen/tailwind",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Kaizen Tailwind presets",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "yarn clean && yarn prepublish",
|
|
7
|
+
"build:ts": "tsc --project tsconfig.dist.json",
|
|
8
|
+
"build:watch": "yarn clean && yarn prepublish --watch",
|
|
9
|
+
"prepublish": "tsc --project tsconfig.dist.json",
|
|
10
|
+
"clean": "rimraf '**/*.d.ts' '**/*.js' '**/*.map'"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/cultureamp/kaizen-design-system.git",
|
|
15
|
+
"directory": "packages/tailwind"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/cultureamp/kaizen-design-system/issues"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"dist",
|
|
23
|
+
"!**/*.spec.*",
|
|
24
|
+
"!docs"
|
|
25
|
+
],
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"author": "",
|
|
28
|
+
"private": false,
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@kaizen/design-tokens": "^2.10.3 || ^3.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0",
|
|
32
|
+
"classnames": "^2.3.1"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@kaizen/draft-divider": "^2.2.3",
|
|
36
|
+
"rimraf": "^3.0.2",
|
|
37
|
+
"tailwindcss": "^3.2.4"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^16.14.0 || ^17.0.0 || ^18.0.0"
|
|
41
|
+
},
|
|
42
|
+
"gitHead": "c5a4e844c40876e2591a25803d9c37fa8f4e470b"
|
|
43
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tailwind-presets"
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as twDefaultTheme from "tailwindcss/defaultTheme"
|
|
2
|
+
import { ThemeConfig } from "tailwindcss/types/config"
|
|
3
|
+
|
|
4
|
+
import { defaultTheme } from "@kaizen/design-tokens"
|
|
5
|
+
|
|
6
|
+
export type KaizenTailwindTheme = Partial<ThemeConfig>
|
|
7
|
+
export interface KaizenTailwindPreset {
|
|
8
|
+
theme: KaizenTailwindTheme
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Note: changing any token will require to to run build:ts from the root `design-tokens`
|
|
12
|
+
export const kaizenTailwindTheme: KaizenTailwindTheme = {
|
|
13
|
+
colors: {
|
|
14
|
+
transparent: "transparent",
|
|
15
|
+
current: "currentColor",
|
|
16
|
+
inherit: "inherit",
|
|
17
|
+
...defaultTheme.color,
|
|
18
|
+
...defaultTheme.dataViz,
|
|
19
|
+
},
|
|
20
|
+
spacing: {
|
|
21
|
+
...defaultTheme.spacing,
|
|
22
|
+
...twDefaultTheme.spacing,
|
|
23
|
+
},
|
|
24
|
+
boxShadow: {
|
|
25
|
+
none: "none",
|
|
26
|
+
sm: defaultTheme.shadow.small.boxShadow,
|
|
27
|
+
lg: defaultTheme.shadow.large.boxShadow,
|
|
28
|
+
},
|
|
29
|
+
borderRadius: {
|
|
30
|
+
none: "0px",
|
|
31
|
+
default: "7px",
|
|
32
|
+
"focus-ring": "10px",
|
|
33
|
+
full: "100%",
|
|
34
|
+
},
|
|
35
|
+
borderWidth: {
|
|
36
|
+
"width-none": "0px",
|
|
37
|
+
"width-default": "2px",
|
|
38
|
+
"width-focus-ring": "2px",
|
|
39
|
+
},
|
|
40
|
+
// how do we want to handle our focus rings?
|
|
41
|
+
// tailwind used a `ring` property
|
|
42
|
+
borderColor: {
|
|
43
|
+
"color-solid": `${defaultTheme.border.solid.borderColor}`,
|
|
44
|
+
"color-transparent": `${defaultTheme.border.borderless.borderColor}`,
|
|
45
|
+
"color-focus-ring": defaultTheme.color.blue[600],
|
|
46
|
+
...defaultTheme.color,
|
|
47
|
+
},
|
|
48
|
+
fontFamily: {
|
|
49
|
+
"family-paragraph": [`${defaultTheme.typography.paragraphBody.fontFamily}`],
|
|
50
|
+
"family-heading": [`${defaultTheme.typography.heading1.fontFamily}`],
|
|
51
|
+
"family-data": [`${defaultTheme.typography.dataLarge.fontFamily}`],
|
|
52
|
+
"family-display": [`${defaultTheme.typography.display0.fontFamily}`],
|
|
53
|
+
},
|
|
54
|
+
fontSize: {
|
|
55
|
+
"size-display": `${defaultTheme.typography.display0.fontSize}`,
|
|
56
|
+
"size-heading-1": `${defaultTheme.typography.heading1.fontSize}`,
|
|
57
|
+
"size-heading-2": `${defaultTheme.typography.heading2.fontSize}`,
|
|
58
|
+
"size-heading-3": `${defaultTheme.typography.heading3.fontSize}`,
|
|
59
|
+
"size-heading-4": `${defaultTheme.typography.heading4.fontSize}`,
|
|
60
|
+
"size-heading-5": `${defaultTheme.typography.heading5.fontSize}`,
|
|
61
|
+
"size-heading-6": `${defaultTheme.typography.heading6.fontSize}`,
|
|
62
|
+
"size-paragraph": `${defaultTheme.typography.paragraphBody.fontSize}`,
|
|
63
|
+
"size-paragraph-lede": `${defaultTheme.typography.paragraphIntroLede.fontSize}`,
|
|
64
|
+
"size-paragraph-sm": `${defaultTheme.typography.paragraphSmall.fontSize}`,
|
|
65
|
+
"size-paragraph-xs": `${defaultTheme.typography.paragraphExtraSmall.fontSize}`,
|
|
66
|
+
"size-data-lg": `${defaultTheme.typography.dataLarge.fontSize}`,
|
|
67
|
+
"size-data-md": `${defaultTheme.typography.dataMedium.fontSize}`,
|
|
68
|
+
"size-data-sm": `${defaultTheme.typography.dataSmall.fontSize}`,
|
|
69
|
+
"size-data-units-lg": `${defaultTheme.typography.dataLargeUnits.fontSize}`,
|
|
70
|
+
"size-data-units-md": `${defaultTheme.typography.dataMediumUnits.fontSize}`,
|
|
71
|
+
"size-data-units-sm": `${defaultTheme.typography.dataSmallUnits.fontSize}`,
|
|
72
|
+
},
|
|
73
|
+
// font weights could have specific tokens (current don't)
|
|
74
|
+
fontWeight: {
|
|
75
|
+
"weight-paragraph": "400",
|
|
76
|
+
"weight-paragraph-bold": "600",
|
|
77
|
+
"weight-data": "700",
|
|
78
|
+
"weight-heading": "700",
|
|
79
|
+
"weight-display": "800",
|
|
80
|
+
"weight-normal": "400",
|
|
81
|
+
"weight-medium": "500",
|
|
82
|
+
"weight-semibold": "600",
|
|
83
|
+
"weight-bold": "700",
|
|
84
|
+
"weight-extrabold": "800",
|
|
85
|
+
},
|
|
86
|
+
lineHeight: {
|
|
87
|
+
"height-display": `${defaultTheme.typography.display0.lineHeight}`,
|
|
88
|
+
"height-heading-1": `${defaultTheme.typography.heading1.lineHeight}`,
|
|
89
|
+
"height-heading-2": `${defaultTheme.typography.heading2.lineHeight}`,
|
|
90
|
+
"height-heading-3": `${defaultTheme.typography.heading3.lineHeight}`,
|
|
91
|
+
"height-heading-4": `${defaultTheme.typography.heading4.lineHeight}`,
|
|
92
|
+
"height-heading-5": `${defaultTheme.typography.heading5.lineHeight}`,
|
|
93
|
+
"height-heading-6": `${defaultTheme.typography.heading6.lineHeight}`,
|
|
94
|
+
"height-paragraph": `${defaultTheme.typography.paragraphBody.lineHeight}`,
|
|
95
|
+
"height-paragraph-lede": `${defaultTheme.typography.paragraphIntroLede.lineHeight}`,
|
|
96
|
+
"height-paragraph-sm": `${defaultTheme.typography.paragraphSmall.lineHeight}`,
|
|
97
|
+
"height-paragraph-xs": `${defaultTheme.typography.paragraphExtraSmall.lineHeight}`,
|
|
98
|
+
"height-data-lg": `${defaultTheme.typography.dataLarge.lineHeight}`,
|
|
99
|
+
"height-data-md": `${defaultTheme.typography.dataMedium.lineHeight}`,
|
|
100
|
+
"height-data-sm": `${defaultTheme.typography.dataSmall.lineHeight}`,
|
|
101
|
+
"height-data-units-lg": `${defaultTheme.typography.dataLargeUnits.lineHeight}`,
|
|
102
|
+
"height-data-units-md": `${defaultTheme.typography.dataMediumUnits.lineHeight}`,
|
|
103
|
+
"height-data-units-sm": `${defaultTheme.typography.dataSmallUnits.lineHeight}`,
|
|
104
|
+
},
|
|
105
|
+
letterSpacing: {
|
|
106
|
+
"spacing-normal": "normal",
|
|
107
|
+
},
|
|
108
|
+
// A mix of layout styles
|
|
109
|
+
maxWidth: {
|
|
110
|
+
...twDefaultTheme.maxWidth,
|
|
111
|
+
content: defaultTheme.layout.contentMaxWidth,
|
|
112
|
+
"content-with-side": defaultTheme.layout.contentMaxWidthWithSidebar,
|
|
113
|
+
},
|
|
114
|
+
width: {
|
|
115
|
+
...twDefaultTheme.width,
|
|
116
|
+
"content-side-margin": defaultTheme.layout.contentSideMargin,
|
|
117
|
+
},
|
|
118
|
+
height: {
|
|
119
|
+
...twDefaultTheme.height,
|
|
120
|
+
"mobile-actions-drawer-height":
|
|
121
|
+
defaultTheme.layout.mobileActionsDrawerHeight,
|
|
122
|
+
"navigation-bar-height": defaultTheme.layout.navigationBarHeight,
|
|
123
|
+
},
|
|
124
|
+
// we will probably want to review viewport sizing
|
|
125
|
+
screens: {
|
|
126
|
+
"media-min-md": defaultTheme.layout.breakpoints.medium, // => @media (min-width: 768px) { ... }
|
|
127
|
+
"media-min-lg": defaultTheme.layout.breakpoints.large, // => @media (min-width: 1080px) { ... }
|
|
128
|
+
"media-max-md": { max: defaultTheme.layout.breakpoints.medium }, // => @media (max-width: 768px) { ... }
|
|
129
|
+
"media-max-lg": { max: defaultTheme.layout.breakpoints.large }, // => @media (min-width: 1080px) { ... }
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const Preset: KaizenTailwindPreset = {
|
|
134
|
+
theme: kaizenTailwindTheme,
|
|
135
|
+
}
|