-
-
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.
docs(hiccup-css): add doc strings for attrib fns
- Loading branch information
1 parent
721583a
commit 22bc29c
Showing
1 changed file
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,52 @@ | ||
const $ = (op) => (id: string, x: string | number, caseSensitve = false) => `[${id}${op}="${x}"${caseSensitve ? " i" : ""}]`; | ||
|
||
/** | ||
* Returns attrib selector: `[id]` | ||
* | ||
* @param id | ||
*/ | ||
export const withAttrib = (id: string) => `[${id}]`; | ||
|
||
/** | ||
* Returns attrib selector `[id=x]` | ||
* | ||
* @param id | ||
* @param x | ||
* @param caseSensitive | ||
*/ | ||
export const attribEq = $(""); | ||
|
||
/** | ||
* Returns attrib selector `[id~=x]` | ||
* | ||
* @param id | ||
* @param x | ||
* @param caseSensitive | ||
*/ | ||
export const attribContains = $("~"); | ||
|
||
/** | ||
* Returns attrib selector `[id^=x]` | ||
* | ||
* @param id | ||
* @param x | ||
* @param caseSensitive | ||
*/ | ||
export const attribPrefix = $("^"); | ||
|
||
/** | ||
* Returns attrib selector `[id$=x]` | ||
* | ||
* @param id | ||
* @param x | ||
* @param caseSensitive | ||
*/ | ||
export const attribSuffix = $("$"); | ||
|
||
/** | ||
* Returns attrib selector `[id*=x]` | ||
* @param id | ||
* @param x | ||
* @param caseSensitive | ||
*/ | ||
export const attribMatches = $("*"); |