Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

# v1.0.0

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

# v0.9.1

- [x] minification passes #66
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Thierry Bela
Copyright (c) 2023-present Thierry Bela

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ $ deno add @tbela99/css-parser
- fault-tolerant parser, will try to fix invalid tokens according to the CSS syntax module 3 recommendations.
- fast and efficient minification without unsafe transforms,
see [benchmark](https://tbela99.github.io/css-parser/benchmark/index.html)
- minify colors.
- support css color level 4 & 5: color(), lab(), lch(), oklab(), oklch(), color-mix(), light-dark(), system colors and
- minify colors: color(), lab(), lch(), oklab(), oklch(), color-mix(), light-dark(), system colors and
relative color
- generate nested css rules
- convert nested css rules to legacy syntax
- generate sourcemap
- compute css shorthands. see supported properties list below
- evaluate math functions: calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(), acos(),
atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign()
- css transform functions minification
- evaluate math functions: calc(), clamp(), min(), max(), etc.
- inline css variables
- remove duplicate properties
- flatten @import rules
Expand Down Expand Up @@ -96,7 +95,7 @@ Javascript module from cdn

<script type="module">

import {transform} from 'https://esm.sh/@tbela99/css-parser@0.9.0/web';
import {transform} from 'https://esm.sh/@tbela99/css-parser@1.0.0/web';


const css = `
Expand Down Expand Up @@ -159,6 +158,7 @@ Include ParseOptions and RenderOptions
- expandNestingRules: boolean, optional. convert nesting rules into separate rules. will automatically set nestingRules
to false.
- removeDuplicateDeclarations: boolean, optional. remove duplicate declarations.
- computeTransform: boolean, optional. compute css transform functions.
- computeShorthand: boolean, optional. compute shorthand properties.
- computeCalcExpression: boolean, optional. evaluate calc() expression
- inlineCssVariables: boolean, optional. replace some css variables with their actual value. they must be declared once
Expand All @@ -176,13 +176,18 @@ Include ParseOptions and RenderOptions
- src: string, optional. original css file location to be used with sourcemap, also used to resolve url().
- sourcemap: boolean, optional. preserve node location data.

> Misc Options
> Ast Traversal Options

- visitor: VisitorNodeMap, optional. node visitor used to transform the ast.

> Urls and \@import Options

- resolveImport: boolean, optional. replace @import rule by the content of the referenced stylesheet.
- resolveUrls: boolean, optional. resolve css 'url()' according to the parameters 'src' and 'cwd'
- resolveImport: boolean, optional. replace @import rule by the content of its referenced stylesheet.

> Misc Options
- removeCharset: boolean, optional. remove @charset.
- cwd: string, optional. destination directory used to resolve url().
- visitor: VisitorNodeMap, optional. node visitor used to transform the ast.
- signal: AbortSignal, optional. abort parsing.

#### RenderOptions
Expand Down Expand Up @@ -701,6 +706,8 @@ for (const {node, parent, root} of walk(ast)) {

## Minification

- [x] minify keyframs
- [x] minify transform
- [x] evaluate math functions calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(),
acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign()
- [x] multi-pass minification
Expand Down
6 changes: 0 additions & 6 deletions Writerside/c.list

This file was deleted.

12 changes: 0 additions & 12 deletions Writerside/cfg/buildprofiles.xml

This file was deleted.

14 changes: 0 additions & 14 deletions Writerside/in.tree

This file was deleted.

45 changes: 0 additions & 45 deletions Writerside/topics/Reference.topic

This file was deleted.

5 changes: 0 additions & 5 deletions Writerside/v.list

This file was deleted.

8 changes: 0 additions & 8 deletions Writerside/writerside.cfg

This file was deleted.

Loading