Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/happydom.ts
/bunfig.toml
/test
/files
/build.sh
/docs
/benchmark
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v1.3.3

- [x] relative color computation bug #105
- [x] allow duplicated declarations of whitelisted properties #106

## v1.3.2

- [x] add missing return type
Expand Down
46 changes: 41 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ $ deno add @tbela99/css-parser
- flatten @import rules
- experimental CSS prefix removal

## Online documentation

See the full documentation at the [CSS Parser](https://tbela99.github.io/css-parser/docs) documentation site

## Playground

Try it [online](https://tbela99.github.io/css-parser/playground/)
Expand Down Expand Up @@ -97,8 +101,7 @@ Javascript module from cdn

<script type="module">

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

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

const css = `
.s {
Expand All @@ -119,11 +122,44 @@ Javascript module
<script src="dist/web.js" type="module"></script>
```

Single Javascript file
Javascript umd module from cdn

```javascript
```html

<script src="https://unpkg.com/@tbela99/css-parser@1.3.2/dist/index-umd-web.js"></script>
<script>

(async () => {

const css = `

.table {
border-collapse: collapse;
width: 100%;
}

<script src="dist/index-umd-web.js"></script>
.table td, .table th {
border: 1px solid #ddd;
padding: 8px;
}

.table tr:nth-child(even){background-color: #f2f2f2;}

.table tr:hover {background-color: #ddd;}

.table th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
`;

console.debug(await CSSParser.transform(css, {beautify: true, convertColor: CSSParser.ColorType.OKLCH}).then(r => r.code));
})();

</script>
```

## Transform
Expand Down
Loading