Skip to content

Latest commit

 

History

History
344 lines (264 loc) · 7.91 KB

File metadata and controls

344 lines (264 loc) · 7.91 KB

Changelog

v1.4.2

  • fix bug when using remove prefix #120

v1.4.0

CSS Module support

  • scoped name generation
  • composes:
    • compose from local selector
    • compose from other files
    • compose from global selector
    • comma separated compose list
  • :local
  • :global
  • :local()
  • :global()
  • selector
  • dashed ident (custom properties)
  • css at-rule property
  • css at-rule value
  • keyframe animations
  • grid
  • naming
    • ignore
    • camelCase
    • camelCaseOnly
    • dashCase
    • dashCaseOnly
  • default mode
    • global
    • local
    • pure(at least one class or id)
    • icss
      • :import
      • :export

Bug Fixes

  • fix <integer> syntax validation #115

v1.3.4

  • make streaming optional #109
  • patch at-rule syntax for @font-feature-value #110
  • support percentage in transform() and scale() #111
  • allow arrays in visitor definition #112

v1.3.3

  • relative color computation bug #105
  • allow duplicated declarations of whitelisted properties #106

v1.3.2

  • add missing return type

v1.3.1

  • generate documentation
  • parse input from readable stream
  • add parseFile() and transformFile()

v1.3.0

  • numerical and dimension tokens use numbers instead of string
  • fix bug when inlineCssVariables is disabled and computeCalcExpression is enabled

V1.2.0

  • convert color to any supported color space #94
  • dead code removal #93
  • validation syntax update #92

v1.1.1

  • fix bug when css nesting is disabled #89
  • validation rules update #87

v1.1.0

  • inline sourcemap
  • CSS validation using mdn-data
  • prefix removal now remove prefixes from all nodes. prefixed linear gradients are not supported

v1.0.0

  • current color parse error when used in color functions
  • minification : CSS transform module level 2
    • translate
    • scale
    • rotate
    • skew
    • perspective
    • matrix
    • matrix3d
  • keyframes
    • remove consecutive keyframes with the same name
    • reduce keyframe selector 'from' to '0%'
    • reduce keyframe selector '100%' to 'to'
    • remove keyframe selector ignored declarations
    • merge keyframe rules and declarations
  • trim extra space in declaration value 'url() 15%' -> 'url()15%', '1% !important' -> '1%!important'
  • allow empty value for css variable declaration '--color: ;'
  • change generate nesting rule default to true

v0.9.1

  • minification passes #66
  • nesting selector cannot match pseudo element #67

v0.9.0

validation

  • validate invalid pseudo classes
  • rewrite selector validation
  • lenient mode that preserves
    • unknown at-rules
    • unknown declarations
    • unknown pseudo classes

media query level 5

  • at-rule custom-media
  • at-rule when-else custom media
  • at-rule charset validation
  • media query error handling
  • at-rule container
  • expand at-rule custom-media
  • expand at-rule when-else

selector validation

  • pseudo class arguments validation
  • pseudo class validation

declaration validation

  • validate declaration

error validation

  • when a parent is marked as invalid node, do not parse or validate descendant nodes

v0.8.0

  • validate selectors using mdn data
  • at-rules prefix removal
  • at rules validation
    • at-rule prelude
    • at-rule body
    • keyframe validation
    • :not() does not accept pseudo classes
    • do not validate declarations in @supports
  • declarations validation
  • evaluate math functions: calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(), acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign() #49
  • incorrectly parse compound selector #51

v0.7.1

  • fix nesting rules expansion #45

v0.7.0

  • fix merging rules
  • experimental CSS prefix removal
    • declaration name
    • declaration value
    • exclude -webkit-* gradients
  • css selector validation
    • pseudo element
    • partial pseudo class validation. does not validate parameters
    • attribute selector
    • combinator
    • simple selector
    • nested selector
    • strict vs permissive validation: allow unknown items such as pseudo classes
      • allow unknown pseudo classes
      • allow unknown attribute selectors
  • strip universal selector when possible

v0.6.0

  • light-dark() color
  • system color

V0.5.4

  • incorrectly expand css nesting rules

v0.5.3

  • incorrectly expand css nesting rules

v0.5.1

  • failed to flatten @import when using url() syntax

v0.5.0

  • render node with parents
  • fix relative color from xyz
  • fix bug when inlineCss is true but no css variable exists
  • compute more shorthands
  • (web) fetch imported css files from external domains using cors

v0.4.1

no code change

v0.4.0

Parsing

  • allow async node visitors
  • adding declaration parsing helper async parseDeclarations(source: string): Promise<AstDeclarations[]>

CSS color level 4 & 5

  • color space: srgb, srgb-linear, display-p3, prophoto-rgb, a98-rgb, rec2020, xyz, xyz-d50
  • color-mix()
  • color()
  • relative color
  • lab()
  • lch()
  • oklab()
  • oklch()

v0.3.0

shorthands

  • column-rule
  • columns
  • container
  • flex
  • flex-flow
  • gap

Other

  • renamed RenderOptions.colorConvert to RenderOptions.convertColor
  • support none keyword in color
  • css relative color syntax for rgb(), hsl() and hwb() colors https://www.w3.org/TR/css-color-5/#relative-colors
    • rgb
    • hex
    • hsl
    • hwb
    • calc()
    • calc() and inline var()

v0.2.0

  • cancellable parser promise using abortSignal
  • node visitor (callback) :
    • Declaration visitor
    • selector visitor
    • at-rule visitor
  • support mixing units with calc()

shorthands

  • transition
  • list-style
  • text-emphasis
  • animation

Minification

v0.1.0

  • sourcemap generation
  • reduce calc():
  • inline css variables
  • configure duplicate declarations removal
  • configure shorthand properties computation

v0.0.1

Minification

  • merge identical rules
  • merge adjacent rules
  • minify colors
  • minify numbers and Dimensions tokens
  • compute shorthand: see the list below
  • remove redundant declarations
  • simple shorthand properties (padding, margin, etc). must have all required properties
  • complex shorthand properties (background, font, etc.). may have optional properties
  • conditionally unwrap :is()
  • automatic css nesting
  • automatically wrap selectors using :is()
  • multi-level shorthand properties ( border - [border-width, border-color, border-style, etc.]) https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties
  • avoid reparsing (declarations, selectors, at-rule)
  • node and browser versions
  • decode and replace utf-8 escape sequence

Computed shorthands

  • background
  • border
  • border-bottom
  • border-color
  • border-left
  • border-radius
  • border-right
  • border-style
  • border-top
  • border-width
  • font
  • inset
  • margin
  • outline
  • overflow
  • padding
  • text-decoration

Performance

  • flatten @import

Error handling

  • parse bad comments / cdo comments
  • parse bad string 1
  • parse bad string 2
  • parse empty declaration
  • parse unclosed rule
  • parse unclosed at-rule
  • parse bad import

Testing

  • node tests
  • browser tests

Code Coverage

  • node
  • browser