-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hiccup-html): add more elements, update readme
- Loading branch information
1 parent
57c6901
commit 5e3f8f1
Showing
10 changed files
with
260 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { | ||
Attribs, | ||
AttribVal, | ||
CORSAttribs, | ||
ImportanceAttribs, | ||
ReferrerAttribs, | ||
RelAttribs, | ||
} from "./api"; | ||
import { defElement, defElements } from "./def"; | ||
|
||
export const [head, title] = defElements(["head", "title"]); | ||
|
||
export interface BaseAttribs extends Attribs { | ||
href: AttribVal<string>; | ||
target: AttribVal<string>; | ||
} | ||
|
||
export const base = defElement<Partial<BaseAttribs>, never>("base"); | ||
|
||
export interface MetaAttribs extends Attribs { | ||
charset: AttribVal<string>; | ||
content: AttribVal<string>; | ||
"http-equiv": AttribVal< | ||
| "content-language" | ||
| "content-security-policy" | ||
| "content-type" | ||
| "default-style" | ||
| "refresh" | ||
| "set-cookie" | ||
| "x-ua-compatible" | ||
>; | ||
name: AttribVal<string>; | ||
} | ||
|
||
export const meta = defElement<Partial<MetaAttribs>, never>("meta"); | ||
|
||
export interface LinkAttribs | ||
extends Attribs, | ||
CORSAttribs, | ||
ImportanceAttribs, | ||
ReferrerAttribs, | ||
RelAttribs { | ||
as: AttribVal< | ||
| "audio" | ||
| "document" | ||
| "embed" | ||
| "fetch" | ||
| "font" | ||
| "image" | ||
| "object" | ||
| "script" | ||
| "style" | ||
| "track" | ||
| "video" | ||
| "worker" | ||
>; | ||
disabled: AttribVal<boolean>; | ||
href: AttribVal<string>; | ||
hreflang: AttribVal<string>; | ||
integrity: AttribVal<string>; | ||
media: AttribVal<string>; | ||
sizes: AttribVal<string | string[]>; | ||
type: AttribVal<string>; | ||
} | ||
|
||
export const link = defElement<Partial<LinkAttribs>, never>("link"); | ||
|
||
export interface StyleAttribs extends Attribs { | ||
media: AttribVal<string>; | ||
nonce: AttribVal<string>; | ||
type: AttribVal<string>; | ||
} | ||
|
||
export const style = defElement<Partial<StyleAttribs>, string>("style"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.