-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change only fixes the `CssScanner` to parse CSS custom properties as IDENT tokens. Additional work may be needed to actually make the built-in CSS Grammar aware of custom properties, but at this time this is not needed to prevent EPUBCheck from reporting custom properties as errors. Fix #790
- Loading branch information
Showing
4 changed files
with
65 additions
and
4 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,37 @@ | ||
/*Examples taken from MDN "Using custom properties"*/ | ||
|
||
/* Basics */ | ||
|
||
:root { | ||
--main-bg-color: brown; | ||
} | ||
|
||
.one { | ||
color: white; | ||
background-color: var(--main-bg-color); | ||
margin: 10px; | ||
width: 50px; | ||
height: 50px; | ||
display: inline-block; | ||
} | ||
|
||
|
||
/* Fallbacks */ | ||
|
||
.two { | ||
color: var(--my-var, red); /* Red if --my-var is not defined */ | ||
} | ||
|
||
.three { | ||
background-color: var(--my-var, var(--my-background, pink)); /* pink if my-var and --my-background are not defined */ | ||
} | ||
|
||
.three { | ||
background-color: var(--my-var, --my-background, pink); /* Invalid: "--my-background, pink" */ | ||
} | ||
|
||
/* Invalid variable */ | ||
|
||
:root { --text-color: 16px; } | ||
p { color: blue; } | ||
p { color: var(--text-color); } |