@teacss/preset-standard 0.3.8 → 0.4.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/README.md +40 -0
- package/dist/index.js +4 -4
- package/dist/merge.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -151,6 +151,44 @@ so components remain responsible for `aria-busy`, `aria-hidden`, `inert`, and
|
|
|
151
151
|
replacement-content behavior where appropriate. There are no `skeleton:*`
|
|
152
152
|
variants or compatibility aliases.
|
|
153
153
|
|
|
154
|
+
## Arrow Shortcuts
|
|
155
|
+
|
|
156
|
+
Two families draw a directional mark on the element's `::after`.
|
|
157
|
+
|
|
158
|
+
`chevron-up`, `chevron-down`, `chevron-left`, and `chevron-right` are stroked: a
|
|
159
|
+
square showing only its right and bottom borders, so the visible ink is one
|
|
160
|
+
corner, rotated until that corner points where the name says. The corner rests
|
|
161
|
+
pointing south-east and `rotate` turns clockwise, so `chevron-down` is 45deg and
|
|
162
|
+
each further quarter turn moves one step round.
|
|
163
|
+
|
|
164
|
+
`triangle-up`, `triangle-down`, `triangle-left`, and `triangle-right` are solid:
|
|
165
|
+
the same box filled and clipped to three corners. `clip-path` rather than the
|
|
166
|
+
zero-size border trick, so `w` and `h` still mean the mark's size and `bg-color`
|
|
167
|
+
still means its color, and both families compose with the same utilities.
|
|
168
|
+
|
|
169
|
+
```html
|
|
170
|
+
<span class="chevron-right">Continue</span>
|
|
171
|
+
<span class="triangle-down">More</span>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The mark follows the surrounding text color, and `display:inline-block` sizes it
|
|
175
|
+
on an ordinary inline host rather than only inside a flex row. Neither family
|
|
176
|
+
carries spacing, opacity, or a size beyond the square.
|
|
177
|
+
|
|
178
|
+
Every declaration lands on the host's `::after`, so a utility aimed at the mark
|
|
179
|
+
carries an `@::after` condition; a bare one styles the host box instead. The
|
|
180
|
+
mark inherits the host's color, so `text-color:` needs no condition:
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<span class="hstack gap:2x triangle-right w:4@::after opacity:80@::after">More</span>
|
|
184
|
+
<span class="triangle-up text-color:red-700">Rising</span>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`transition-property:transform` covers `rotate` in this preset, so a state that
|
|
188
|
+
re-rotates a mark animates, and `motion-reduce` turns that off. All eight are one
|
|
189
|
+
mutually exclusive merge family, because they own the same `::after`:
|
|
190
|
+
`cn("chevron-up", "triangle-down")` keeps only the later.
|
|
191
|
+
|
|
154
192
|
## Preflight
|
|
155
193
|
|
|
156
194
|
The standard preset emits a low-specificity foundational reset and its theme
|
|
@@ -252,6 +290,8 @@ Bare keywords are a closed standard-preset vocabulary:
|
|
|
252
290
|
```txt
|
|
253
291
|
hstack vstack centered inline-centered
|
|
254
292
|
truncate skeleton
|
|
293
|
+
chevron-up chevron-down chevron-left chevron-right
|
|
294
|
+
triangle-up triangle-down triangle-left triangle-right
|
|
255
295
|
sr-only sr-visible
|
|
256
296
|
transition-none transition-all transition-colors transition-opacity transition-shadow transition-transform
|
|
257
297
|
reset-heading reset-list
|