-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
37 additions
and
20 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 |
---|---|---|
@@ -1,21 +1,14 @@ | ||
import { DASH, FAMILY, FONT, FONT_PREFIX, F_PREFIX, MONO, SANS, SERIF, VAR_END, VAR_START } from './constants/css-property-keyword'; | ||
import { DASH, FAMILY, FONT, MONO, SANS, SERIF, VAR_END, VAR_START } from './constants/css-property-keyword'; | ||
import { Style } from '@master/style'; | ||
|
||
const VAR_F = VAR_START + 'f' + DASH; | ||
|
||
export class FontFamilyStyle extends Style { | ||
static override prefixes = /^f-family:/; | ||
static override prefixes = /^f-family:|f(ont)?:(mono|sans|serif)/; | ||
static override key = FONT + DASH + FAMILY; | ||
static override values = { | ||
mono: VAR_F + MONO + VAR_END, | ||
sans: VAR_F + SANS + VAR_END, | ||
serif: VAR_F + SERIF + VAR_END | ||
} | ||
static override semantics = {}; | ||
} | ||
|
||
for (const name in FontFamilyStyle.values) { | ||
const value = FontFamilyStyle.values[name]; | ||
FontFamilyStyle.semantics[F_PREFIX + name] = value; | ||
FontFamilyStyle.semantics[FONT_PREFIX + name] = value; | ||
} |
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,7 @@ | ||
import { OUTLINE } from './constants/css-property-keyword'; | ||
import { Style } from '@master/style'; | ||
|
||
export class OutlineStyle extends Style { | ||
static override prefixes = /^outline:/; | ||
static override key = OUTLINE; | ||
} |
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,12 +1,12 @@ | ||
import { DASH, FIRST, LETTER, TEXT, TRANSFORM, UPPERCASE } from './constants/css-property-keyword'; | ||
import { DASH, FIRST, LETTER, UPPERCASE } from './constants/css-property-keyword'; | ||
import { Style } from '@master/style'; | ||
|
||
export class TextLeadingStyle extends Style { | ||
static override prefixes = /^t(ext)?:leading/; | ||
static override fixedPseudo = ':' + FIRST + DASH + LETTER; | ||
static override fixedPseudo = '::' + FIRST + DASH + LETTER; | ||
override get parseValue() { | ||
return { | ||
[TEXT + DASH + TRANSFORM]: UPPERCASE | ||
'text-transform': UPPERCASE | ||
}; | ||
} | ||
} |