Skip to content

Commit

Permalink
add css3-fonts and unicode-range highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
i-akhmadullin committed Aug 14, 2014
1 parent d722cab commit f86d1a5
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 18 deletions.
69 changes: 61 additions & 8 deletions CSS3.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -776,8 +776,7 @@
<key>comment</key>
<string>animatable properties</string>
<key>match</key>
<string>\b(all|
|background(-color|-image|-position|-size)?|
<string>\b(background(-color|-image|-position|-size)?|
|border-(bottom-|top-)?(right-|left-)radius|
|border-(bottom|left|right|top)-color|
|border-(bottom|left|right|top)-width|
Expand Down Expand Up @@ -822,9 +821,11 @@
|oblique|optimize(Legibility|Quality|Speed)|outset|outside|overline|
|pointer|pre(-(wrap|line))?|progress|
|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|
|s-resize|scroll-position|scroll|se-resize|separate|small-caps|solid|square|static|strict|sub|super|sw-resize|
|s-resize|scroll-position|scroll|se-resize|separate|solid|square|static|strict|sub|super|sw-resize|
|table(-footer-group|-header-group|-cell|-caption|-column-group|-column|-row-group|-row)?|
|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical(-(ideographic|text))?|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|zero|smaller|larger|((xx?-)?(small|large))|painted|
|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical(-(ideographic|text))?|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|zero|smaller|larger|
|((all-)?(petite|small)|titling)-caps|
|((xx?-)?(small|large))|painted|
|repeating-(linear|radial)-gradient|
|border-box|
|content-box|
Expand All @@ -851,9 +852,19 @@
|reverse|round|rotate(X|Y|Z|3d)?|running|
|scale(X|Y|Z|3d)?|skew(X|Y)?|space-between|space-around|space|span|stack|start|step-(end|start)|stretch|stroke|subtract|subgrid|
|textfield|to|touch|transform|translate(X|Y|Z|3d)?|
|unset|
|unicase|unset|
|(column|row|wrap)(-reverse)?|
|fill|
|(diagonal|stacked)-fractions|
|ordinal|
|(?:ultra-|extra-|semi-)?(?:condensed|expanded)|
|(lining|oldstyle|proportional|tabular)-nums|
|slashed-zero|
|historical-forms|
|((no-)?(common|discretionary|historical))-ligatures|
|(no-)?contextual|
|all|
|jis04|jis78|jis83|jis90|simplified|traditional|(full|proportional)-width|ruby|
|startColorStr|EndColorStr)\b</string>
<key>name</key>
<string>support.constant.property-value.css</string>
Expand All @@ -872,6 +883,10 @@
<key>name</key>
<string>support.constant.font-name.css</string>
</dict>
<dict>
<key>include</key>
<string>#unicode-range</string>
</dict>
<dict>
<key>include</key>
<string>#numeric-values</string>
Expand Down Expand Up @@ -1309,8 +1324,6 @@
|interpolation-mode|
|filter|
|flex(-align|-basis|-direction|-flow|-grow|-item-align|-order|-shrink|-wrap|-pack|-line-pack)?|
|font-effect|font-emphasize(-position|-style)?|
|font-smoothing|osx-font-smoothing|
|hyphens|
|isolation|
|justify-content|
Expand All @@ -1333,7 +1346,13 @@
|transition(-delay|-duration|-property|-timing-function)?|
|user-select|
|will-change|word-break|writing-mode|
|background-attachment|background-color|background-image|background-position|background-repeat|background|box-shadow|border-radius|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|image-rendering|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow(-[xy])?|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|src|stress|table-layout|text-(align|decoration|indent|rendering|shadow|transform)|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-(spacing|wrap)|zoom|z-index|text-justify)\b</string>
|background-attachment|background-color|background-image|background-position|background-repeat|background|box-shadow|border-radius|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|
|osx-font-smoothing|
|font(?:-)(?:effect|emphasize(-position|-style)?|family|feature-settings|kerning|language-override|size(?:-adjust)?|smoothing|stretch|style|synthesis|variant(?:-alternates|-caps|-east-asian|-ligatures|-numeric|-position)?|weight)?|
|height|image-rendering|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow(-[xy])?|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|size|
|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|src|stress|table-layout|text-(align|decoration|indent|rendering|shadow|transform)|top|
|unicode-(?:bidi|range)|
|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-(spacing|wrap)|zoom|z-index|text-justify)\b</string>
<key>name</key>
<string>support.type.property-name.css</string>
</dict>
Expand Down Expand Up @@ -1698,6 +1717,40 @@
</dict>
</array>
</dict>
<key>unicode-range</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.unicode-range.prefix.css</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.codepoint-range.css</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.section.range.css</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)
(u\+)
([0-9a-f?]{1,6}
(?:(-)[0-9a-f]{1,6})?)
</string>
<key>name</key>
<string>support.unicode-range.css</string>
</dict>
</array>
</dict>
<key>vendor-prefix</key>
<dict>
<key>match</key>
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ flex-flow, flex-grow, flex-item-align, flex-line-pack
flex-order, flex-pack, flex-shrink, flex-wrap
font-effect
font-emphasize, font-emphasize-position, font-emphasize-style
font-feature-settings, font-kerning font-language-override
font-stretch, font-synthesis
font-variant-ligatures, font-variant-position, font-variant-caps
font-variant-numeric, font-variant-alternates, font-variant-east-asian
group
grid-area
Expand Down Expand Up @@ -103,6 +107,7 @@ text-emphasis
text-overflow
text-size-adjust
unicode-range
user-select
word-break
Expand Down Expand Up @@ -165,6 +170,19 @@ touch
initial, unset
ultra-condensed, extra-condensed, condensed, semi-condensed
semi-expanded, expanded, extra-expanded, ultra-expanded
common-ligatures, no-common-ligatures
discretionary-ligatures, no-discretionary-ligatures
historical-ligatures, no-historical-ligatures
contextual, no-contextual
all-small-caps, petite-caps, all-petite-caps, unicase, titling-caps
lining-nums, oldstyle-nums, proportional-nums, tabular-nums
diagonal-fractions, stacked-fractions, ordinal, slashed-zero
historical-forms
jis78, jis83, jis90, jis04, simplified, traditional
full-width, proportional-width, ruby
progid:DXImageTransform.Microsoft.Alpha, alpha
progid:DXImageTransform.Microsoft.Blur
progid:DXImageTransform.Microsoft.dropshadow
Expand Down Expand Up @@ -248,6 +266,11 @@ keygen, main, math, menuitem, picture, source, svg, template, track
vw,vh,vmin,vmax,turn,ms,dppx
```

#### Unicode-range
```
U+416, U+400-4ff, U+4??
```

#### Custom Properties for Cascading Variables
```
--my-variable: 20px;
Expand Down
25 changes: 20 additions & 5 deletions src/repository/property-values.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
<key>comment</key>
<string>animatable properties</string>
<key>match</key>
<string>\b(all|
|background(-color|-image|-position|-size)?|
<string>\b(background(-color|-image|-position|-size)?|
|border-(bottom-|top-)?(right-|left-)radius|
|border-(bottom|left|right|top)-color|
|border-(bottom|left|right|top)-width|
Expand Down Expand Up @@ -70,9 +69,11 @@
|oblique|optimize(Legibility|Quality|Speed)|outset|outside|overline|
|pointer|pre(-(wrap|line))?|progress|
|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|
|s-resize|scroll-position|scroll|se-resize|separate|small-caps|solid|square|static|strict|sub|super|sw-resize|
|s-resize|scroll-position|scroll|se-resize|separate|solid|square|static|strict|sub|super|sw-resize|
|table(-footer-group|-header-group|-cell|-caption|-column-group|-column|-row-group|-row)?|
|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical(-(ideographic|text))?|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|zero|smaller|larger|((xx?-)?(small|large))|painted|
|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical(-(ideographic|text))?|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|zero|smaller|larger|
|((all-)?(petite|small)|titling)-caps|
|((xx?-)?(small|large))|painted|
|repeating-(linear|radial)-gradient|
|border-box|
|content-box|
Expand All @@ -99,9 +100,19 @@
|reverse|round|rotate(X|Y|Z|3d)?|running|
|scale(X|Y|Z|3d)?|skew(X|Y)?|space-between|space-around|space|span|stack|start|step-(end|start)|stretch|stroke|subtract|subgrid|
|textfield|to|touch|transform|translate(X|Y|Z|3d)?|
|unset|
|unicase|unset|
|(column|row|wrap)(-reverse)?|
|fill|
|(diagonal|stacked)-fractions|
|ordinal|
|(?:ultra-|extra-|semi-)?(?:condensed|expanded)|
|(lining|oldstyle|proportional|tabular)-nums|
|slashed-zero|
|historical-forms|
|((no-)?(common|discretionary|historical))-ligatures|
|(no-)?contextual|
|all|
|jis04|jis78|jis83|jis90|simplified|traditional|(full|proportional)-width|ruby|
|startColorStr|EndColorStr)\b</string>
<key>name</key>
<string>support.constant.property-value.css</string>
Expand All @@ -120,6 +131,10 @@
<key>name</key>
<string>support.constant.font-name.css</string>
</dict>
<dict>
<key>include</key>
<string>#unicode-range</string>
</dict>
<dict>
<key>include</key>
<string>#numeric-values</string>
Expand Down
10 changes: 7 additions & 3 deletions src/repository/rule-list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@
|interpolation-mode|
|filter|
|flex(-align|-basis|-direction|-flow|-grow|-item-align|-order|-shrink|-wrap|-pack|-line-pack)?|
|font-effect|font-emphasize(-position|-style)?|
|font-smoothing|osx-font-smoothing|
|hyphens|
|isolation|
|justify-content|
Expand All @@ -125,7 +123,13 @@
|transition(-delay|-duration|-property|-timing-function)?|
|user-select|
|will-change|word-break|writing-mode|
|background-attachment|background-color|background-image|background-position|background-repeat|background|box-shadow|border-radius|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|font-family|font-size-adjust|font-size|font-stretch|font-style|font-variant|font-weight|font|height|image-rendering|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow(-[xy])?|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|src|stress|table-layout|text-(align|decoration|indent|rendering|shadow|transform)|top|unicode-bidi|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-(spacing|wrap)|zoom|z-index|text-justify)\b</string>
|background-attachment|background-color|background-image|background-position|background-repeat|background|box-shadow|border-radius|border-bottom-color|border-bottom-style|border-bottom-width|border-bottom|border-collapse|border-color|border-left-color|border-left-style|border-left-width|border-left|border-right-color|border-right-style|border-right-width|border-right|border-spacing|border-style|border-top-color|border-top-style|border-top-width|border-top|border-width|border|bottom|caption-side|clear|clip|color|content|counter-increment|counter-reset|cue-after|cue-before|cue|cursor|direction|display|elevation|empty-cells|float|
|osx-font-smoothing|
|font(?:-)(?:effect|emphasize(-position|-style)?|family|feature-settings|kerning|language-override|size(?:-adjust)?|smoothing|stretch|style|synthesis|variant(?:-alternates|-caps|-east-asian|-ligatures|-numeric|-position)?|weight)?|
|height|image-rendering|left|letter-spacing|line-height|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|marker-offset|margin|marks|max-height|max-width|min-height|min-width|opacity|orphans|outline-color|outline-style|outline-width|outline|overflow(-[xy])?|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page|pause-after|pause-before|pause|pitch-range|pitch|play-during|pointer-events|position|quotes|resize|richness|right|size|
|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|src|stress|table-layout|text-(align|decoration|indent|rendering|shadow|transform)|top|
|unicode-(?:bidi|range)|
|vertical-align|visibility|voice-family|volume|white-space|widows|width|word-(spacing|wrap)|zoom|z-index|text-justify)\b</string>
<key>name</key>
<string>support.type.property-name.css</string>
</dict>
Expand Down
34 changes: 34 additions & 0 deletions src/repository/unicode-range.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<key>unicode-range</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.constant.unicode-range.prefix.css</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.codepoint-range.css</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.section.range.css</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)
(u\+)
([0-9a-f?]{1,6}
(?:(-)[0-9a-f]{1,6})?)
</string>
<key>name</key>
<string>support.unicode-range.css</string>
</dict>
</array>
</dict>
43 changes: 41 additions & 2 deletions test.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ keygen,main,math,menuitem,picture,source,svg,template,track {
width: calc(100%/3 - 2*1em - 2*1px);
width: calc((-50vh + 72px)/2 + 24px - 46px);
}
@media (min-resolution: 50dppx){}
@media (-webkit-min-device-pixel-ratio: 2),
@media (min-resolution: 50dppx),
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 2),
(min-device-pixel-ratio: 2),
(min--moz-device-pixel-ratio: 2),
(min-resolution: 2dppx){}
Expand Down Expand Up @@ -514,3 +515,41 @@ dialog::backdrop{}

@media (scripting:initial-only) { ... }
@media (scripting:enabled) { ... }

/* http://www.w3.org/TR/css3-fonts/ */
/* @font-feature-values support not implemented */
.css3-fonts {
font-stretch:
ultra-condensed, extra-condensed, condensed, semi-condensed,
semi-expanded, expanded, extra-expanded, ultra-expanded;
font-synthesis: none;
font-feature-settings: "liga", "dlig", "tnum", 'hist';
font-language-override: "SRB";
font-variant-ligatures: common-ligatures, no-common-ligatures,
discretionary-ligatures, no-discretionary-ligatures,
historical-ligatures, no-historical-ligatures,
contextual, no-contextual;
font-variant-position: sub, super;
font-kerning: normal;
font-variant-caps:
small-caps, all-small-caps,
petite-caps, all-petite-caps,
unicase, titling-caps;
font-variant-numeric:
lining-nums, oldstyle-nums, proportional-nums, tabular-nums,
diagonal-fractions, stacked-fractions,
ordinal, slashed-zero;
/* partially hightlighted */
font-variant-alternates: historical-forms,
stylistic(<feature-value-name>),
styleset(<feature-value-name> #),
character-variant(<feature-value-name> #),
swash(<feature-value-name>),
ornaments(<feature-value-name>),
annotation(<feature-value-name>);
font-variant-east-asian:
jis78, jis83, jis90, jis04,
simplified, traditional,
full-width, proportional-width, ruby;
unicode-range: U+416, U+400-4ff, U+4??;
}

0 comments on commit f86d1a5

Please sign in to comment.