Skip to content

Commit a299e5d

Browse files
committed
bump version #43
1 parent 9676337 commit a299e5d

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

CHANGELOG.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@
44

55
- [x] fix merging rules
66
- [ ] experimental CSS prefix removal
7-
- [x] declarations
8-
- [ ] declaration values
9-
- [ ] exclude -webkit-* gradients
10-
- [x] css selector validation
11-
- [x] pseudo element
12-
- [x] partial pseudo class validation. does not validate parameters
13-
- [x] attribute selector
14-
- [x] combinator
15-
- [x] simple selector
16-
- [x] nested selector
17-
- [ ] strict mode: allow unknown items such as pseudo classes
18-
- [x] allow unknown pseudo classes
19-
- [x] allow unknown attribute selectors
7+
- [x] declaration name
8+
- [ ] declaration value
9+
- [ ] exclude -webkit-* gradients
10+
- [x] css selector validation
11+
- [x] pseudo element
12+
- [x] partial pseudo class validation. does not validate parameters
13+
- [x] attribute selector
14+
- [x] combinator
15+
- [x] simple selector
16+
- [x] nested selector
17+
- [x] strict vs permissive validation: allow unknown items such as pseudo classes
18+
- [x] allow unknown pseudo classes
19+
- [x] allow unknown attribute selectors
2020
- [x] strip universal selector when possible
2121

2222
# v0.6.0
23+
2324
- [x] light-dark() color
2425
- [x] system color
2526

@@ -77,15 +78,16 @@ CSS color level 4 & 5
7778
- [x] gap
7879

7980
### Other
81+
8082
- [x] renamed RenderOptions.colorConvert to RenderOptions.convertColor
8183
- [x] support none keyword in color
8284
- [x] css relative color syntax for rgb(), hsl() and hwb() colors https://www.w3.org/TR/css-color-5/#relative-colors
83-
- [x] rgb
84-
- [x] hex
85-
- [x] hsl
86-
- [x] hwb
87-
- [x] calc()
88-
- [x] calc() and inline var()
85+
- [x] rgb
86+
- [x] hex
87+
- [x] hsl
88+
- [x] hwb
89+
- [x] calc()
90+
- [x] calc() and inline var()
8991

9092
## v0.2.0
9193

@@ -112,7 +114,7 @@ CSS color level 4 & 5
112114
## v0.1.0
113115

114116
- [x] sourcemap generation
115-
- [x] reduce calc():
117+
- [x] reduce calc():
116118
- [x] inline css variables
117119
- [x] configure duplicate declarations removal
118120
- [x] configure shorthand properties computation
@@ -123,7 +125,7 @@ CSS color level 4 & 5
123125

124126
- [x] merge identical rules
125127
- [x] merge adjacent rules
126-
- [x] minify colors
128+
- [x] minify colors
127129
- [x] minify numbers and Dimensions tokens
128130
- [x] compute shorthand: see the list below
129131
- [x] remove redundant declarations
@@ -132,12 +134,14 @@ CSS color level 4 & 5
132134
- [x] conditionally unwrap :is()
133135
- [x] automatic css nesting
134136
- [x] automatically wrap selectors using :is()
135-
- [x] multi-level shorthand properties (border - [border-width, border-color, border-style, etc.]) https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties
137+
- [x] multi-level shorthand properties (
138+
border - [border-width, border-color, border-style, etc.]) https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties
136139
- [x] avoid reparsing (declarations, selectors, at-rule)
137140
- [x] node and browser versions
138141
- [x] decode and replace utf-8 escape sequence
139142

140143
### Computed shorthands
144+
141145
- [x] background
142146
- [x] border
143147
- [x] border-bottom

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@tbela99/css-parser",
33
"description": "CSS parser for node and the browser",
4-
"version": "0.7.0-aplha.2",
4+
"version": "0.7.0",
55
"exports": {
66
".": "./dist/node/index.js",
77
"./umd": "./dist/index-umd-web.js",

src/lib/validation/selector.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function validatePseudoClass(selector: PseudoClassToken, options: ValidationOpti
359359

360360
return {
361361

362-
valid: isValid || !options.validation ? ValidationLevel.Valid : ValidationLevel.Drop,
362+
valid: isValid || !options.validation ? ValidationLevel.Valid : ValidationLevel.Drop,
363363
nodes: [selector],
364364
error: isValid ? '' : 'invalid selector'
365365
}
@@ -387,7 +387,7 @@ function validatePseudoClassFunction(selector: PseudoClassFunctionToken, options
387387
if (!('chi' in config.selectors[selector.val].ast[0])) {
388388

389389
return {
390-
valid: !options.validation ? ValidationLevel.Valid : ValidationLevel.Drop,
390+
valid: !options.validation ? ValidationLevel.Valid : ValidationLevel.Drop,
391391
nodes: [selector],
392392
error: ''
393393
}
@@ -396,7 +396,7 @@ function validatePseudoClassFunction(selector: PseudoClassFunctionToken, options
396396
} else if (!(selector.val + '()' in config.selectors)) {
397397

398398
return {
399-
valid: !options.validation ? ValidationLevel.Valid : ValidationLevel.Drop,
399+
valid: !options.validation ? ValidationLevel.Valid : ValidationLevel.Drop,
400400
nodes: [selector],
401401
error: ''
402402
}
@@ -575,7 +575,7 @@ function validateAttributeSelector(selector: AttrToken, options: ValidationOptio
575575
// @ts-ignore
576576
if (!hasWhitespace || i >= selector.chi.length || selector.chi[i].typ != EnumToken.IdenTokenType || !['i', 's'].includes((<EnumToken.IdenTokenType>selector.chi[i]).val)) {
577577

578-
const valid = !options.validation && selector.chi[i].typ == EnumToken.IdenTokenType && (<IdentToken>selector.chi[i]).val.match(/^[a-z]$/);
578+
const valid = !options.validation && selector.chi[i].typ == EnumToken.IdenTokenType && (<IdentToken>selector.chi[i]).val.match(/^[a-z]$/);
579579
return {
580580
valid: valid ? ValidationLevel.Valid : ValidationLevel.Drop,
581581
nodes: [selector],

0 commit comments

Comments
 (0)