Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dom-inline-styles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clack/ui': patch
---

Add inline style declarations with shared camelCase, dashed, and setProperty access, supported CSS value parsing, and change notifications.
4 changes: 3 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"test": "pnpm --filter @bomb.sh/web-platform-tests build && bsh test"
},
"dependencies": {
"@bomb.sh/tty": "catalog:"
"@bomb.sh/tty": "catalog:",
"@standard-schema/spec": "^1.1.0",
"hueful": "^0.8.1"
},
"devEngines": {
"packageManager": {
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { asciiUppercase, asciiLowercase } from './ascii.ts';
import { NamedNodeMap } from './named-node-map.ts';
import { HTMLCollection } from './html-collection.ts';
import { StyleDeclaration } from './style.ts';
import {
validateElementName,
validateElementNamespace,
Expand Down Expand Up @@ -330,6 +331,7 @@ export abstract class Node extends EventTarget {
}

export class Element extends Node {
readonly style: StyleDeclaration;
readonly localName: string;
readonly nodeName: string;
readonly namespaceURI: string | null;
Expand All @@ -344,6 +346,7 @@ export class Element extends Node {
{ namespaceURI = HTML_NS, prefix = null }: Partial<ElementNamespace> = {},
) {
super(owner, notify);
this.style = new StyleDeclaration(this.notify);
this.localName = localName;
this.namespaceURI = namespaceURI;
this.prefix = prefix;
Expand Down
8 changes: 8 additions & 0 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
export { createUI } from './ui.ts';
export type {
ColorValue,
BorderWidthValue,
FlexDirectionValue,
DisplayValue,
LengthValue,
BorderStyleValue,
} from './style.ts';
Loading
Loading