- Bumped
css-treeto~2.2.0(#458)
- Fixed usage filtering for from/to selectors in keyframes at-rule (#448)
- Fixed removing
mediuminfontdeclarations since it breaks the value since<font-size>is required (#449)
- Fixed CommonJS version bundling when
browserfield is used - Added
modulefield
- Extended Node.js support to include
^10 - Fixed
mainfield inpackage.jsonto refer to CommonJS module - Bumped
css-treeto~2.0.4(fixed CSS serialization issue in IE11)
- Bumped
css-treeto~2.0.3(various fixes on generate CSS) - Added exports:
csso/syntax
- Added support for CSS Selectors Level 4 and legacy pseudos in specificity calculation, i.e.
:has(),:not(<selector-list>),:is(),:matches(),:-moz-any(),:-webkit-any(),:where(),:nth-child(... of <selector-list>)and:nth-last-child(... of <selector-list>) - Package
- Changed supported versions of Node.js to
^12.20.0,^14.13.0and>=15.0.0(extended in5.0.2to include^10) - Converted to ES modules. However, CommonJS is supported as well (dual module)
- Changed bundle set to provide
dist/csso.js(an IIFE version withcssoas a global name) anddist/csso.esm.js(as ES module). Both are minified - Bumped
css-treeto2.0
- Changed supported versions of Node.js to
- Trim Custom Property values when possible (#393)
- Fixed removing unit for zero-length dimentions in
min(),max()andclamp()functions (#426) - Fixed crash on bad value in TRBL declaration value (#412)
- Fixed build setup to exclude full
mdn/datathat reduced the lib size:- dist/csso.js: 794.5Kb -> 255.2Kb
- dist/csso.min.js: 394.4Kb -> 194.2Kb
- package size: 237.8 kB -> 156.1 kB
- package unpacked size: 1.3 MB -> 586.8 kB
- Bumped CSSTree to
^1.0.0 - Fixed wrongly merging of TRBL values when one of them contains
var()(#420) - Fixed wrongly merging of pseudo class and element with the same name, e.g.
:-ms-input-placeholderand::-ms-input-placeholder(#383, #416) - Fixed wrongly merging of
overflowfallback (#415)
- Prevented percent sign removal in
flex/-ms-flex(#410) - Fixed restructuring optimisation in some cases (@charlessuh & @chsuh, #358, #411)
- Bumped dependencies (@AviVahl, #409)
- Fixed clean stage to avoid exceptions when source has unparsed or bad parts (#380)
- Fixed wrong percentage sign removal for zero values (#395)
- Bumped CSSTree to
1.0.0-alpha.37to avoid source map generation inconsistency across Node.js versions
- Dropped support for Node.js < 8
- Refreshed dev dependencies and scripts
- Bumped CSSTree to
1.0.0-alpha.36(#399) - Changed bundle files:
dist/csso.jsanddist/csso.min.jsinstead singledist/csso-browser.js(min version) - Expose
compress()assyntax.compress()
- Bumped CSSTree to
1.0.0-alpha.29(fixes some issues)
- Migrated to CSSTree
1.0.0-alpha.27
- Added percent sign removal for zero percentages for some properties that is safe (@RubaXa, #286)
- Removed unit removal for zero values in
-ms-flexdue it breaks flex in IE10/11 (#362) - Improved performance of selectors comparison (@smelukov, #343)
- Fixed merge of
positiondeclarations whenstickyfallback is using (@gruzzilkin, #356)
- Migrated to CSSTree
1.0.0-alpha25- Changed AST format (see CSSTree change log for details)
- Fixed performance issue when generate CSS with source map (quadratic increase in time depending on the size of the CSS)
- Fixed named color compression to apply only when an identifier is guaranteed to be a color
- Added lifting of
@keyframesto the beginning of style sheet (chunk), but after@charsetand@importrules - Added removal of
@keyframes,@mediaand@supportswith no prelude - Added removal of duplicate
@keyframes(#202) - Added new option
forceMediaMergeto force media rules merging. It's unsafe in general, but works fine in many cases. Use it on your own risk (#350) - Bumped
CSSTreeto1.0.0-alpha23
- Fixed crash on a number processing when it used not in a list (#335)
- Implemented optimisation for
nonekeyword inborderandoutlineproperties (@zoobestik, #41) - Implemented replacing
rgba(x, x, x, 0)totransparent - Fixed plus sign omitting for numbers following identifier, hex color, number or unicode range, since it can change the meaning of CSS (e.g.
calc(1px+2px)has been optimized tocalc(1px2px)before, now it stays the same) - Improved usage filtering for nested selectors (i.e. for
:nth-*(),:has(),:matchesand other pseudos) - Implemented
blacklistfiltering in usage (#334, see Black list filtering) - Improved white space removing, now white spaces are removing in the beginning and at the ending of sequences, and between stylesheet and block nodes
- Bumped
CSSTreeto1.0.0-alpha19
- Fixed declaration merging when declaration contains an
!important
- Migrated to CSSTree as AST backend and exposed its API behind
syntaxproperty - Extracted CLI into standalone package css/csso-cli
- Added
\0IE hack support (#320)
- Added
beforeCompressandafterCompressoptions support (#316) - Fixed crash on empty argument in function (#317)
- Fixed shorthand optimisation issue when value has a color value or something unknown (#311)
- Fixed
cursorbroken fallback (#306)
- Implement AST cloning by adding
clone()function andcloneoption forcompress()function (#296) - Fix parse and translate attribute selector with flags but w/o operator (i.e.
[attrName i]) - Don't merge rules with flagged attribute selectors with others (#291)
- Take in account functions when merge TRBL-properties (#297, thanks to @ArturAralin)
- Improve partial merge (#304)
- Tweak scanner, reduce code deoptimizations and other small improvements
- Fix wrong declaration with
\9hack merge (#295)
- New option
commentsto specify what comments to left:exclamation,first-exclamationandnone - Add
offsetto CSS parse error details - Fix token
offsetcomputation
- No more
gonzalesAST format and related code minify()andminifyBlock()is always return an object as result now (i.e.{ css: String, map: SourceMapGenerator or null })parse()- Returns AST in new format (so called
internal) - Dynamic scanner implemented
- New AST format + dynamic scanner = performance boost and less memory consumption
- No more
contextargument, context should be specified viaoptions - Supported contexts now:
stylesheet,atrule,atruleExpression,ruleset,selector,simpleSelector,block,declarationandvalue - Drop
needPositionsoption,positionsoption should be used instead - Drop
needInfooption,infoobject is attaching to nodes when some information is requested byoptions optionsshould be an object, otherwise it treats as empty object
- Returns AST in new format (so called
compress()- No more AST converting (performance boost and less memory consumption)
- Drop
outputAstoption - Returns an object as result instead of AST (i.e.
{ ast: Object })
- Drop methods:
justDoIt(),stringify(),cleanInfo()
- Don't remove spaces after function/braces/urls since unsafe (#289)
- Usage data support:
- Filter rulesets by tag names, class names and ids white lists.
- More aggressive ruleset moving using class name scopes information.
- New CLI option
--usageto pass usage data file.
- Improve initial ruleset merge
- Change order of ruleset processing, now it's left to right. Previously unmerged rulesets may prevent lookup and other rulesets merge.
- Difference in pseudo signature just prevents ruleset merging, but don't stop lookup.
- Simplify block comparison (performance).
- New method
csso.minifyBlock()for css block compression (e.g.styleattribute content). - Ruleset merge improvement: at-rules with block (like
@mediaor@supports) now can be skipped during ruleset merge lookup if doesn't contain something prevents it. - FIX: Add negation (
:not()) to pseudo signature to avoid unsafe merge (old browsers doesn't support it). - FIX: Check nested parts of value when compute compatibility. It fixes unsafe property merging.
- pass block mode to tokenizer for correct parsing of declarations properties with
//hack - fix wrongly
@importand@charsetremoval on double exclamation comment
- support for CSS Custom Properties (#279)
- rework RTBL properties merge – better merge for values with special units and don't merge values with CSS-wide keywords (#255)
- remove redundant universal selectors (#178)
- take in account
!importantwhen check for property overriding (#280) - don't merge
text-aligndeclarations with some values (#281) - add spaces around
/deep/combinator on translate, since it together with universal selector can produce a comment - better keyword and property name resolving (tolerant to hacks and so on)
- integration improvements
- compression log function could be customized by
loggeroption forcompress()andminify() - make possible to set initial line and column for parser
- compression log function could be customized by
npmpublish issue (#276)
- add
fileto generated source map since other tools can relay on it in source map transform chain
- tweak some parse error messages and their positions
- fix
:not()parsing and selector groups in:not()is supported now (#215) needPositionparser option is deprecated,positionsoption should be used instead (needPositionis used still ifpositionsoption omitted)- expose internal AST API as
csso.internal.* minify()addssourcesContentby default when source map is generated- bring back support for node.js
0.10until major release (#275)
- fix exception on zero length dimension compress outside declaration (#273)
- source maps support
- parser remake:
- various parsing issues fixed
- fix unicode sequence processing in ident (#191)
- support for flags in attribute selector (#270)
- position (line and column) of parse error (#109)
- 4x performance boost, less memory consumption
- compressor refactoring
- internal AST is using doubly linked lists (with safe transformation support during iteration) instead of arrays
- rename
restructuringtorestructureoption forminify()/compress()(restructuringis alias forrestructurenow, with lower priority) - unquote urls when possible (#141, #60)
- setup code coverage and a number of related fixes
- add eslint to check unused things
- one more fix (in
restructRulesetthis time) with merge of rulesets when a ruleset with same specificity places between them (#264) - disable partial merge of rulesets in
@keyframesrulesets (until sure it's correct)
- don't override display values with different browser support (#259)
- fix publish issue (one of modules leak in development state)
- don't merge rulesets if between them a ruleset with same specificity (#264)
- ensure
-is not used as an identifier in attribute selectors (thanks to @mathiasbynens) - fix broken
justDoIt()function - various small fixes
- attach minus to number
- split code base into small modules and related refactoring
- introduce internal AST format for compressor (
gonzales→internalandinternal→gonzalesconvertors, walkers, translator) - various optimizations: no snapshots, using caches and indexes
- sort selectors, merge selectors in alphabet order
- compute selector's specificity
- better ruleset restructuring, improve compression of partially equal blocks
- better ruleset merge – not only closest but also disjoined by other rulesets when safe
- join
@mediawith same query outputAst– new option to specify output AST format (gonzalesby default for backward compatibility)- remove quotes surrounding attribute values in attribute selectors when possible (#73)
- replace
from→0%and100%→toat@keyframes(#205) - prevent partial merge of rulesets at
@keyframes(#80, #197)
- walker for
gonzalesAST was implemented
- new option
--stat(output stat instderr) - new optional parameter
levelfor--debugoption
- prevent removal of spaces after braces that before identifier that breaking at-rules expressions (#258)
- fix unicode-range parsing that cause to wrong function detection (#250)
- allow spaces between
progid:and rest part of value for IE'sfilterproperty asautoprefixergenerates this kind of code (#249) - fixes for Windows:
- correct processing new lines
- normalize file content in test suite
- fixes to work in strict mode (#252)
- init compressor dictionaries for every css block (#248, #251)
- bump uglify-js version
- allow merge for
displayproperty (#167, #244) - more accurate
rect(clipproperty value) merge - fix typo when specifying options in cli (thanks to @Taritsyn)
- fix safe unit values merge with keyword values (#244)
- fix wrong descendant combinator removal (#246)
- build browser version on
prepublish(thanks to @silentroach) - parser: store whitespaces as single token (performance and reduce memory consumption)
- rearrange compress tests layout
Bringing project back to life. Changed files structure, cleaned up and refactored most of sources.
- single code base (no more
srcfolder) - build browser version with
browserify(no moremake, andwebfolder), browser version is available atdist/csso-browser.js - main file is
lib/index.jsnow - minimal
node.jsversion is0.12now - restrict file list to publish on npm (no more useless folders and files in package)
- add
jscsto control code style - automate
gh-pagesupdate - util functions reworked
- translator reworked
- test suite reworked
- compressor refactored
- initial parser refactoring
- new method
minify(src, options), options:restructuring– if set tofalse, disable structure optimisations (trueby default)debug- outputs intermediate state of CSS during compression (falseby default)
- deprecate
justDoIt()method (useminifyinstead) - rename
treeToString()method tostringify() - drop
printTree()method - AST node info
columnandoffsetaddedlnrenamed toline- fix line counting across multiple files and input with CR LF (#147)
- completely reworked, use clap to parse argv
- add support for input from stdin (#128)
- drop undocumented and obsoleted options
--ruleand--parser(suppose nobody use it) - drop
-offalias for--restructure-offas incorrect (only one letter options should starts with single-) - new option
--debugthat reflecting tooptions.debugforminify
- keep all exclamation comments (#194)
- add
/deep/combinator support (#209) - attribute selector
- allow colon in attribute name (#237)
- support for namespaces (#233)
- color
- support all css/html colors
- convert
hslatorgbaandhlstorgb - convert
rgbawith 1 as alpha value torgb(#122) - interpolate
rgbandrgbapercentage values to absolute values - replace percentage values in
rgbafor normalized/interpolated values - lowercase hex colors and color names (#169)
- fix color minification when hex value replaced for color name (#176)
- fit rgb values to 0..255 range (#181)
- calc
- remove spaces for multiple operator in calc
- don't remove units inside calc (#222)
- fix wrong white space removal around
+and-(#228)
- don't remove units in
flexproperty as it could change value meaning (#200) - don't merge
\9hack values (#231) - merge property values only if they have the same functions (#150, #227)
- don't merge property values with some sort of units (#140, #161)
- fix
!importantissue fortop-right-bottom-leftproperties (#189) - fix
top-right-bottom-leftproperties merge (#139, #175) - support for unicode-range (#148)
- don't crash on ruleset with no selector (#135)
- tolerant to class names that starts with digit (#99, #105)
- fix background compressing (#170)
- Case insensitive check for
!important(#187) - Fix problems with using
cssoas cli command on Windows (#83, #136, #142 and others) - Remove byte order marker (the UTF-8 BOM) from input
- Don't strip space between funktion-funktion and funktion-vhash (#134)
- Don't merge TRBL values having \9 (hack for IE8 in bootstrap) (#159, #214, #230, #231 and others)
- Don't strip units off dimensions of non-length (#226, #229 and others)
- Gonzales 1.0.7.
- Gonzales 1.0.6.
- Gonzales 1.0.5.
- Protecting copyright notices in CSS: #92
- Zero CSS throws an error: #96
- Don't minify the second
0sin Firefox for animations: #100 - Japan manual
- BEM ready documentation
- @page inside @media Causes Error: #90
- CSSO 1.3.2 compresses ".t-1" and ".t-01" as identical classes: #88
- filter + important breaks CSSO v1.3.1: #87
- "filter" IE property breaks CSSO v1.3.0: #86
- PeCode CSS parser replaced by Gonzales CSS parser