frankenstyle 0.0.5 → 0.0.7
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 +133 -1
- package/dist/css/frankenstyle.css +8474 -101
- package/dist/css/frankenstyle.min.css +1 -1
- package/dist/js/frankenstyle.js +1 -1
- package/dist/js/frankenstyle.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,138 @@
|
|
|
1
|
+
> If you’re already happy with Tailwind CSS, there’s no reason for you to be here.
|
|
2
|
+
|
|
1
3
|
# Frankenstyle
|
|
2
4
|
|
|
3
|
-
Frankenstyle is a no-
|
|
5
|
+
Frankenstyle is a no-build, value-driven, fully responsive, utility-first CSS framework. It’s designed to be lightweight, production-ready, and to strike a balance between developer ergonomics and build size.
|
|
6
|
+
|
|
7
|
+
⚠️ **Early development project** — expect changes and rough edges. Feedback and testing are welcome!
|
|
8
|
+
|
|
9
|
+
📖 **Documentation is coming soon** — for now, explore the examples and notes below.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Frankenstyle can be used via CDN or installed locally.
|
|
14
|
+
|
|
15
|
+
### CDN
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<link
|
|
19
|
+
rel="stylesheet"
|
|
20
|
+
href="https://unpkg.com/frankenstyle@latest/dist/css/frankenstyle.min.css"
|
|
21
|
+
/>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### NPM
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm i frankenstyle@latest
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then import it in your `main.css`:
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
@import "frankenstyle/css/frankenstyle.css";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### JavaScript
|
|
37
|
+
|
|
38
|
+
JavaScript is optional, but important for interactive states:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script src="https://unpkg.com/frankenstyle@latest/dist/js/frankenstyle.min.js"></script>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Core Concepts & Usage
|
|
45
|
+
|
|
46
|
+
Think of Frankenstyle as _Tailwind CSS, but de-valued_. Frankenstyle provides the class, you provide the value.
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<div class="m sm:m md:m" style="--m: 4; --sm-m: 8; --md-m: 16"></div>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Behind the scenes, values are multiplied by a base spacing variable (e.g., `var(--spacing)`).
|
|
53
|
+
|
|
54
|
+
Need arbitrary values? Wrap in brackets:
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div class="[m]" style="--m: 4px;"></div>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You don’t need to memorize odd variable names — just drop special characters from the class.
|
|
61
|
+
|
|
62
|
+
- `sm:m` → `--sm-m`
|
|
63
|
+
- `dark:sm:bg:hover` → `--dark-sm-bg-hover`
|
|
64
|
+
|
|
65
|
+
### States
|
|
66
|
+
|
|
67
|
+
Interactive states (e.g., hover) are generated on demand. Mark an element with `data-fs-interactive`, and the runtime will generate the necessary pseudo-state CSS.
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
class="color bg dark:bg bg:hover dark:bg:hover font-medium rounded-lg text-sm px py"
|
|
73
|
+
style="
|
|
74
|
+
--color: var(--color-white);
|
|
75
|
+
--bg: var(--color-blue-700);
|
|
76
|
+
--dark-bg: var(--color-pink-600);
|
|
77
|
+
--bg-hover: var(--color-blue-800);
|
|
78
|
+
--dark-bg-hover: var(--color-pink-700);
|
|
79
|
+
--px: 5;
|
|
80
|
+
--py: 2.5;
|
|
81
|
+
"
|
|
82
|
+
data-fs-interactive
|
|
83
|
+
>
|
|
84
|
+
Default
|
|
85
|
+
</button>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This avoids shipping huge CSS files for states up front — everything is generated at runtime when needed.
|
|
89
|
+
|
|
90
|
+
### Dark Mode
|
|
91
|
+
|
|
92
|
+
Prefix color utilities with `dark:`:
|
|
93
|
+
|
|
94
|
+
- `bg` → `dark:bg`
|
|
95
|
+
- `color` → `dark:color`
|
|
96
|
+
- `border` → `dark:border`
|
|
97
|
+
- `fill` → `dark:fill`
|
|
98
|
+
|
|
99
|
+
### Opacity
|
|
100
|
+
|
|
101
|
+
Suffix color utilities with `/o`. These require two variables (base + opacity) to avoid inheritance issues:
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<div
|
|
105
|
+
class="bg/o dark:bg/o"
|
|
106
|
+
style="
|
|
107
|
+
--bg: var(--color-blue-800);
|
|
108
|
+
--bg-o: 80%;
|
|
109
|
+
--dark-bg: var(--color-green-800);
|
|
110
|
+
--dark-bg-o: 80%;
|
|
111
|
+
"
|
|
112
|
+
></div>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Responsiveness
|
|
116
|
+
|
|
117
|
+
Prefix classes with breakpoints:
|
|
118
|
+
|
|
119
|
+
- `sm:`
|
|
120
|
+
- `md:`
|
|
121
|
+
- `lg:`
|
|
122
|
+
- `xl:`
|
|
123
|
+
- `2xl:`
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<div class="p sm:p md:p" style="--p: 4; --sm-p: 8; --md-p: 16"></div>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Key Differences from Tailwind
|
|
130
|
+
|
|
131
|
+
- **No config, no file watchers** → everything is statically pre-built.
|
|
132
|
+
- **Value-driven utilities** → use `m` + `--m: 8` or `[m]` for arbitrary values, not `m-8` or `m-[8px]`.
|
|
133
|
+
- **State syntax is reversed** → `bg:hover` instead of `hover:bg-blue-600`.
|
|
134
|
+
- **Runtime state generation** → hover/active CSS is created on the fly, keeping static builds small.
|
|
135
|
+
- **Familiar patterns** → utilities, responsive prefixes, and naming feel similar to Tailwind.
|
|
4
136
|
|
|
5
137
|
## License
|
|
6
138
|
|