@regardio/tailwind 0.3.12 → 0.4.1
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/README.md +19 -106
- package/dist/styles/index.css +6 -6
- package/dist/styles/plugins.css +9 -2
- package/package.json +14 -6
- package/dist/styles/base.css +0 -75
- package/dist/styles/grid.css +0 -61
package/README.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
# @regardio/tailwind
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Tailwind CSS utilities and tools for Regardio projects
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Reusable utilities and tools for Tailwind CSS projects. **Does NOT include design decisions** (colors, fonts, breakpoints) - import those from `@regardio/brand` instead.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
7
|
+
## What This Package Provides
|
|
8
|
+
|
|
9
|
+
- **JavaScript utilities** - Type-safe component variants (`tv`), class merging (`cn`, `twMerge`)
|
|
10
|
+
- **CSS utilities** - Reset, custom animations
|
|
11
|
+
- **Plugin re-exports** - `fluid-tailwindcss`, `tw-animate-css` (integrated via `plugins.css`)
|
|
12
|
+
|
|
13
|
+
> **📖 See [@regardio/brand styling architecture](../brand/docs/styling-architecture.md)** for the complete architecture.
|
|
11
14
|
|
|
12
15
|
## Installation
|
|
13
16
|
|
|
@@ -15,127 +18,37 @@ A unified Tailwind CSS toolchain for Regardio projects, providing:
|
|
|
15
18
|
pnpm add @regardio/tailwind
|
|
16
19
|
```
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
**Peer Dependencies**: `tailwindcss` >= 4.0.0
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
## Quick Start
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
### JavaScript
|
|
23
26
|
|
|
24
27
|
```ts
|
|
25
|
-
import { tv, cn,
|
|
28
|
+
import { tv, cn, type VariantProps } from '@regardio/tailwind/utils';
|
|
26
29
|
|
|
27
|
-
// Create component variants with tv()
|
|
28
30
|
const button = tv({
|
|
29
|
-
base: 'px-4 py-2 rounded
|
|
31
|
+
base: 'px-4 py-2 rounded',
|
|
30
32
|
variants: {
|
|
31
33
|
color: {
|
|
32
34
|
primary: 'bg-blue-500 text-white',
|
|
33
35
|
secondary: 'bg-gray-200 text-gray-800',
|
|
34
36
|
},
|
|
35
|
-
size: {
|
|
36
|
-
sm: 'text-sm',
|
|
37
|
-
md: 'text-base',
|
|
38
|
-
lg: 'text-lg',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
defaultVariants: {
|
|
42
|
-
color: 'primary',
|
|
43
|
-
size: 'md',
|
|
44
37
|
},
|
|
45
38
|
});
|
|
46
|
-
|
|
47
|
-
// Use cn() for simple class merging
|
|
48
|
-
const className = cn('base-class', condition && 'conditional-class', 'override-class');
|
|
49
|
-
|
|
50
|
-
// Type-safe variant props
|
|
51
|
-
type ButtonProps = VariantProps<typeof button>;
|
|
52
39
|
```
|
|
53
40
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Import all shared styles at once:
|
|
41
|
+
### CSS
|
|
57
42
|
|
|
58
43
|
```css
|
|
59
44
|
@import "@regardio/tailwind/styles";
|
|
60
45
|
```
|
|
61
46
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```css
|
|
65
|
-
/* Tailwind CSS + standard plugins (tailwindcss, tw-animate-css, fluid-tailwindcss) */
|
|
66
|
-
@import "@regardio/tailwind/styles/plugins.css";
|
|
67
|
-
|
|
68
|
-
/* Modern CSS reset with accessibility features */
|
|
69
|
-
@import "@regardio/tailwind/styles/reset.css";
|
|
70
|
-
|
|
71
|
-
/* Common base styles (typography, borders) */
|
|
72
|
-
@import "@regardio/tailwind/styles/base.css";
|
|
73
|
-
|
|
74
|
-
/* Grid utilities (.u-container, .u-grid) */
|
|
75
|
-
@import "@regardio/tailwind/styles/grid.css";
|
|
76
|
-
|
|
77
|
-
/* Animation keyframes and duration classes */
|
|
78
|
-
@import "@regardio/tailwind/styles/animations.css";
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Included Styles
|
|
82
|
-
|
|
83
|
-
#### Plugins (`plugins.css`)
|
|
84
|
-
|
|
85
|
-
Tailwind CSS v4 with Regardio's standard plugins:
|
|
86
|
-
|
|
87
|
-
- **tailwindcss** - Core Tailwind CSS
|
|
88
|
-
- **tw-animate-css** - Animation utilities
|
|
89
|
-
- **fluid-tailwindcss** - Fluid typography and spacing plugin
|
|
90
|
-
|
|
91
|
-
#### Reset (`reset.css`)
|
|
92
|
-
|
|
93
|
-
A modern CSS reset based on Josh Comeau's reset with Regardio enhancements:
|
|
94
|
-
|
|
95
|
-
- Box-sizing reset
|
|
96
|
-
- Theme color scheme support (`data-theme="light|dark"`)
|
|
97
|
-
- Typography wrapping (`text-wrap: pretty/balance`)
|
|
98
|
-
- Form element normalization
|
|
99
|
-
- Media element defaults
|
|
100
|
-
- Reduced motion accessibility
|
|
101
|
-
|
|
102
|
-
#### Base (`base.css`)
|
|
103
|
-
|
|
104
|
-
Common base styles that build on the reset:
|
|
105
|
-
|
|
106
|
-
- Font feature settings (ligatures)
|
|
107
|
-
- Border/outline defaults
|
|
108
|
-
- Typography base styles
|
|
109
|
-
|
|
110
|
-
#### Grid Utilities (`grid.css`)
|
|
111
|
-
|
|
112
|
-
Reusable layout classes:
|
|
113
|
-
|
|
114
|
-
- `.u-container` - Max-width container with horizontal padding
|
|
115
|
-
- `.u-grid` - 12-column CSS grid with container queries
|
|
116
|
-
- `.u-grid-full` - Full-width grid item (12 columns)
|
|
117
|
-
- `.u-grid-half` - Half-width grid item (6 columns)
|
|
118
|
-
- `.u-grid-third` - Third-width grid item (4 columns)
|
|
119
|
-
- `.u-grid-quarter` - Quarter-width grid item (3 columns)
|
|
120
|
-
|
|
121
|
-
Configure via CSS custom properties:
|
|
122
|
-
|
|
123
|
-
```css
|
|
124
|
-
:root {
|
|
125
|
-
--spacing-grid-max: 1200px;
|
|
126
|
-
--spacing-grid-gutter: 1rem;
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
#### Animations (`animations.css`)
|
|
131
|
-
|
|
132
|
-
Common animation keyframes and utilities:
|
|
47
|
+
## Documentation
|
|
133
48
|
|
|
134
|
-
- **
|
|
135
|
-
- **
|
|
136
|
-
- **
|
|
137
|
-
- **Scale**: `animate-scale-in`, `animate-scale-out`
|
|
138
|
-
- **Image**: `animate-image-fade-in`, `animate-image-fade-out` (6s duration for slideshows)
|
|
49
|
+
- **[Setup Guide](./docs/setup-guide.md)** - Integration and configuration
|
|
50
|
+
- **[JavaScript Utilities](./docs/javascript-utilities.md)** - `tv()`, `cn()`, `twMerge()` usage
|
|
51
|
+
- **[CSS Utilities](./docs/css-utilities.md)** - Reset, animations, plugins
|
|
139
52
|
|
|
140
53
|
## Why This Package?
|
|
141
54
|
|
package/dist/styles/index.css
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @regardio/tailwind -
|
|
2
|
+
* @regardio/tailwind - Utility Styles
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Reusable utilities and tools for Tailwind CSS projects.
|
|
5
|
+
* Does NOT include design decisions (colors, fonts, breakpoints, layouts).
|
|
6
|
+
* Import design system from @regardio/brand instead.
|
|
7
|
+
*
|
|
8
|
+
* Import all utilities:
|
|
5
9
|
* @import "@regardio/tailwind/styles";
|
|
6
10
|
*
|
|
7
11
|
* Or import individual files:
|
|
8
12
|
* @import "@regardio/tailwind/styles/plugins.css";
|
|
9
13
|
* @import "@regardio/tailwind/styles/reset.css";
|
|
10
|
-
* @import "@regardio/tailwind/styles/base.css";
|
|
11
|
-
* @import "@regardio/tailwind/styles/grid.css";
|
|
12
14
|
* @import "@regardio/tailwind/styles/animations.css";
|
|
13
15
|
*/
|
|
14
16
|
|
|
15
17
|
@import "./plugins.css";
|
|
16
18
|
@import "./reset.css";
|
|
17
|
-
@import "./base.css";
|
|
18
|
-
@import "./grid.css";
|
|
19
19
|
@import "./animations.css";
|
package/dist/styles/plugins.css
CHANGED
|
@@ -9,5 +9,12 @@
|
|
|
9
9
|
/* Animation utilities */
|
|
10
10
|
@import "tw-animate-css";
|
|
11
11
|
|
|
12
|
-
/*
|
|
13
|
-
@plugin "
|
|
12
|
+
/* Tailwind plugins */
|
|
13
|
+
@plugin "@tailwindcss/typography";
|
|
14
|
+
@plugin "fluid-tailwindcss" {
|
|
15
|
+
minViewport: 320;
|
|
16
|
+
maxViewport: 2560;
|
|
17
|
+
useRem: true;
|
|
18
|
+
rootFontSize: 16;
|
|
19
|
+
checkAccessibility: true;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "@regardio/tailwind",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Regardio Tailwind CSS utilities and configuration",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"tailwind",
|
|
9
|
+
"tailwindcss",
|
|
10
|
+
"utilities",
|
|
11
|
+
"regardio"
|
|
12
|
+
],
|
|
8
13
|
"homepage": "https://github.com/regardio/tailwind#readme",
|
|
9
14
|
"bugs": {
|
|
10
15
|
"url": "https://github.com/regardio/tailwind/issues"
|
|
@@ -24,7 +29,9 @@
|
|
|
24
29
|
"types": "./dist/index.d.mts"
|
|
25
30
|
}
|
|
26
31
|
},
|
|
27
|
-
"files": [
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
28
35
|
"scripts": {
|
|
29
36
|
"build": "tsdown",
|
|
30
37
|
"dev": "tsdown --watch",
|
|
@@ -47,6 +54,7 @@
|
|
|
47
54
|
"typecheck": "exec-tsc --noEmit"
|
|
48
55
|
},
|
|
49
56
|
"dependencies": {
|
|
57
|
+
"@tailwindcss/typography": "0.5.19",
|
|
50
58
|
"clsx": "2.1.1",
|
|
51
59
|
"fluid-tailwindcss": "1.0.9",
|
|
52
60
|
"tailwind-merge": "3.5.0",
|
|
@@ -54,12 +62,12 @@
|
|
|
54
62
|
"tw-animate-css": "1.4.0"
|
|
55
63
|
},
|
|
56
64
|
"devDependencies": {
|
|
57
|
-
"@regardio/dev": "1.
|
|
65
|
+
"@regardio/dev": "^1.18.0",
|
|
58
66
|
"@total-typescript/ts-reset": "0.6.1",
|
|
59
67
|
"@types/node": "25.5.0",
|
|
60
68
|
"@vitest/coverage-v8": "4.1.0",
|
|
61
69
|
"@vitest/ui": "4.1.0",
|
|
62
|
-
"tailwindcss": "4.2.
|
|
70
|
+
"tailwindcss": "4.2.2",
|
|
63
71
|
"tsdown": "0.21.4",
|
|
64
72
|
"vitest": "4.1.0"
|
|
65
73
|
},
|
|
@@ -69,4 +77,4 @@
|
|
|
69
77
|
"engines": {
|
|
70
78
|
"node": ">=18"
|
|
71
79
|
}
|
|
72
|
-
}
|
|
80
|
+
}
|
package/dist/styles/base.css
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Styles
|
|
3
|
-
* Foundational design defaults that may vary per project
|
|
4
|
-
*/
|
|
5
|
-
@layer base {
|
|
6
|
-
/* Design tokens applied to all elements */
|
|
7
|
-
* {
|
|
8
|
-
@apply border-border outline-ring/50;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* Body typography defaults */
|
|
12
|
-
body {
|
|
13
|
-
font-feature-settings:
|
|
14
|
-
"liga" 1,
|
|
15
|
-
"dlig" 1,
|
|
16
|
-
"calt" 1,
|
|
17
|
-
"hlig" 1;
|
|
18
|
-
font-variant-ligatures: common-ligatures discretionary-ligatures contextual historical-ligatures;
|
|
19
|
-
line-height: 1.5;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Text wrapping improvements */
|
|
23
|
-
p,
|
|
24
|
-
h1,
|
|
25
|
-
h2,
|
|
26
|
-
h3,
|
|
27
|
-
h4,
|
|
28
|
-
h5,
|
|
29
|
-
h6 {
|
|
30
|
-
overflow-wrap: break-word;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
p {
|
|
34
|
-
text-wrap: pretty;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
h1,
|
|
38
|
-
h2,
|
|
39
|
-
h3,
|
|
40
|
-
h4,
|
|
41
|
-
h5,
|
|
42
|
-
h6 {
|
|
43
|
-
line-height: 1.2;
|
|
44
|
-
text-wrap: balance;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* Focus ring styling */
|
|
48
|
-
:focus-visible {
|
|
49
|
-
@apply outline-2 outline-offset-2;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* Selection styling */
|
|
53
|
-
::selection {
|
|
54
|
-
@apply bg-primary text-primary-foreground;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/* Links without class */
|
|
58
|
-
a:not([class]) {
|
|
59
|
-
text-underline-offset: 0.2em;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/* Prevent tiny textareas */
|
|
63
|
-
textarea:not([rows]) {
|
|
64
|
-
min-height: 10em;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Auto-sizing textareas (progressive enhancement) */
|
|
68
|
-
@supports (field-sizing: content) {
|
|
69
|
-
textarea {
|
|
70
|
-
field-sizing: content;
|
|
71
|
-
min-height: 3lh;
|
|
72
|
-
max-height: 50vh;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
package/dist/styles/grid.css
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Grid Utilities
|
|
3
|
-
* Reusable container and grid layout classes
|
|
4
|
-
*/
|
|
5
|
-
@layer components {
|
|
6
|
-
/**
|
|
7
|
-
* Container with max-width and horizontal padding
|
|
8
|
-
* Uses CSS custom properties for configurability:
|
|
9
|
-
* - --spacing-grid-max: Maximum container width
|
|
10
|
-
* - --spacing-grid-gutter: Horizontal padding/gap
|
|
11
|
-
*/
|
|
12
|
-
.u-container {
|
|
13
|
-
position: relative;
|
|
14
|
-
max-width: var(--spacing-grid-max);
|
|
15
|
-
padding-inline: var(--spacing-grid-gutter);
|
|
16
|
-
margin-inline: auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 12-column CSS Grid with container queries
|
|
21
|
-
* Uses CSS custom properties for configurability:
|
|
22
|
-
* - --spacing-grid-gutter: Gap between grid items
|
|
23
|
-
*/
|
|
24
|
-
.u-grid {
|
|
25
|
-
display: grid;
|
|
26
|
-
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
27
|
-
grid-auto-flow: dense;
|
|
28
|
-
gap: var(--spacing-grid-gutter);
|
|
29
|
-
width: 100%;
|
|
30
|
-
container-name: grid;
|
|
31
|
-
container-type: inline-size;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Full-width grid item spanning all 12 columns
|
|
36
|
-
*/
|
|
37
|
-
.u-grid-full {
|
|
38
|
-
grid-column: 1 / -1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Half-width grid item spanning 6 columns
|
|
43
|
-
*/
|
|
44
|
-
.u-grid-half {
|
|
45
|
-
grid-column: span 6;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Third-width grid item spanning 4 columns
|
|
50
|
-
*/
|
|
51
|
-
.u-grid-third {
|
|
52
|
-
grid-column: span 4;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Quarter-width grid item spanning 3 columns
|
|
57
|
-
*/
|
|
58
|
-
.u-grid-quarter {
|
|
59
|
-
grid-column: span 3;
|
|
60
|
-
}
|
|
61
|
-
}
|