-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hiccup-css): update fn handling, add iterator support, units, co…
…mment - update fn exec rules (now only head pos vs. other pos in array) - add comment() fn - add Format.comments flag - update COMPACT preset to omit comments - add unit format wrappers - rename attribIncl() => attribContains() - rename attribContains() => attribMatches()
- Loading branch information
1 parent
6de6b27
commit 428de3c
Showing
10 changed files
with
115 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const $ = (op) => (id: string, x: string | number, caseSensitve = false) => `[${id}${op}="${x}"${caseSensitve ? " i" : ""}]`; | ||
export const withAttrib = (id: string) => `[${id}]`; | ||
export const attribEq = $(""); | ||
export const attribIncl = $("~"); | ||
export const attribContains = $("~"); | ||
export const attribPrefix = $("^"); | ||
export const attribSuffix = $("$"); | ||
export const attribContains = $("*"); | ||
export const attribMatches = $("*"); |
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,6 @@ | ||
export function comment(body: string, force = false) { | ||
return (acc, opts) => | ||
(opts.format.comments || force ? | ||
(Array.prototype.push.apply(acc, ["/* ", body, " */"]), acc) : | ||
acc); | ||
} |
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
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,12 @@ | ||
export const em = (x: number) => `${x}em`; | ||
export const ex = (x: number) => `${x}ex`; | ||
export const rem = (x: number) => `${x}rem`; | ||
export const perc = (x: number) => `${x}%`; | ||
export const px = (x: number) => `${x}px`; | ||
export const vh = (x: number) => `${x}vh`; | ||
export const vw = (x: number) => `${x}vw`; | ||
|
||
export const ms = (x: number) => `${x}ms`; | ||
export const sec = (x: number) => `${x}s`; | ||
|
||
export const deg = (x: number) => `${x}deg`; |