@stacksjs/ts-css 0.3.27 → 0.3.29
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/dist/bin/cli.js +1 -1
- package/dist/bin/cssx.js +42 -42
- package/dist/engine/index.js +35 -39
- package/dist/engine/resolve.d.ts +17 -0
- package/dist/engine/select-caret.d.ts +24 -0
- package/package.json +1 -1
package/dist/engine/resolve.d.ts
CHANGED
|
@@ -44,6 +44,23 @@ export declare function resolveLineHeight(value: string, fontSize: number, rootF
|
|
|
44
44
|
export declare function resolveColor(value: string, options?: ColorOptions): ResolvedColor | undefined;
|
|
45
45
|
/** `#rrggbb`, or `#rrggbbaa` when not opaque. Meaningful for an sRGB colour. */
|
|
46
46
|
export declare function colorToHex(color: ResolvedColor): string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether sRGB holds the colour, so its hex draws it as the browser does.
|
|
49
|
+
*
|
|
50
|
+
* An sRGB colour always does. A Display P3 one does when each sRGB channel
|
|
51
|
+
* lands within rounding of the 8-bit range: then `colorToHex` of the same
|
|
52
|
+
* value resolved with `space: 'srgb'` is the colour, not a clamp of it. A
|
|
53
|
+
* renderer that can draw P3 needs the P3 value only for the colours that fail
|
|
54
|
+
* this: 82 of the default palette's 242. (95 leave sRGB at all, but 13 pale
|
|
55
|
+
* tints by less than half a step, which their hex already draws.) See #47.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isInSrgbGamut(color: ResolvedColor): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The colour as a CSS value a native renderer reads: `#rrggbb[aa]` for sRGB,
|
|
60
|
+
* `color(display-p3 r g b[ / a])` for Display P3 (#47). Channels go to four
|
|
61
|
+
* places, finer than an 8-bit step.
|
|
62
|
+
*/
|
|
63
|
+
export declare function colorToCSS(color: ResolvedColor): string;
|
|
47
64
|
/**
|
|
48
65
|
* Resolving utilities for a renderer that is not a browser.
|
|
49
66
|
*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The same declarations as a CSS block body, for the forms preflight. */
|
|
2
|
+
export declare function selectCaretCSS(indent?: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* The caret a single-line `<select>` draws, in the text's own colour.
|
|
5
|
+
*
|
|
6
|
+
* It used to be an SVG in a data URI with the stroke written in as `#6b7280`.
|
|
7
|
+
* A data URI is a separate document: it cannot read `currentColor` or a custom
|
|
8
|
+
* property, so on any palette that was not grey-on-white the arrow was the one
|
|
9
|
+
* part of the control that did not match, and an app with light and dark themes
|
|
10
|
+
* had to restate the whole background per theme (stacksjs/ts-css#45).
|
|
11
|
+
*
|
|
12
|
+
* Two gradients can read `currentColor` where the URI cannot. Each paints half
|
|
13
|
+
* of a square tile, and the two tiles side by side make the caret, so it takes
|
|
14
|
+
* the select's `color` under any theme mechanism with nothing to override.
|
|
15
|
+
*
|
|
16
|
+
* A mask does not work here, though it looks like the obvious tool: a mask on
|
|
17
|
+
* a `<select>` clips the WHOLE control, and a `<select>` does not reliably
|
|
18
|
+
* render `::after` to carry one instead.
|
|
19
|
+
*
|
|
20
|
+
* Sized in em, so the caret and the room kept for it scale with the select's
|
|
21
|
+
* own font: a compact 13px picker gets a smaller arrow, closer in, than a 16px
|
|
22
|
+
* field, rather than one fixed size that crowds the small one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SELECT_CARET: Readonly<Record<string, string>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/ts-css",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.29",
|
|
5
5
|
"description": "Pure-TypeScript CSS toolkit and utility-first CSS engine for Bun/Node — parser, walker, generator, selector engine, minifier, and a Tailwind-compatible utility engine. Zero runtime deps.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|