Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/i10416/cssminifier
This library is a simple, dependency free css minifier supporting Scala 2.13, 3 on JVM, JS and Native Platform.
https://github.com/i10416/cssminifier
compression scala scalajs scalanative web
Last synced: 15 days ago
JSON representation
This library is a simple, dependency free css minifier supporting Scala 2.13, 3 on JVM, JS and Native Platform.
- Host: GitHub
- URL: https://github.com/i10416/cssminifier
- Owner: i10416
- Created: 2022-02-06T13:27:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-04T06:06:58.000Z (over 1 year ago)
- Last Synced: 2024-10-15T20:01:34.344Z (22 days ago)
- Topics: compression, scala, scalajs, scalanative, web
- Language: Scala
- Homepage:
- Size: 55.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple CSS Minifier in Pure Scala
[![Release](https://github.com/i10416/cssminifier/actions/workflows/release.yml/badge.svg)](https://github.com/i10416/cssminifier/actions/workflows/release.yml)
| scala 2.13 | scala 3 |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/s01.oss.sonatype.org/dev.i10416/cssminifier_2.13.svg)](https://s01.oss.sonatype.org/content/repositories/snapshots/dev/i10416/cssminifier_2.13/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.i10416/cssminifier_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.i10416/cssminifier_2.13) | [![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/https/s01.oss.sonatype.org/dev.i10416/cssminifier_3.svg)](https://s01.oss.sonatype.org/content/repositories/snapshots/dev/i10416/cssminifier_3/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.i10416/cssminifier_3/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.i10416/cssminifier_3) |This library is a simple, dependency free css minifier supporting Scala 2.13, 3 on JVM, JS and Native Platform.
Algorithm is written in reference to YUI
or.Following features are supported.
- remove leading whitespace-like chars
- remove trailing whitespace-like chars
- remove last semi-colon in braces
- remove repeated semi-colons
- remove comments except ones start with `!`
- remove empty rules
- compress zeros(e.g. `margin:0 0 0 0; => margin:0`,`border:none;=>border:0`)
- collect `@charset` and keep only the first one## Install
```scala
libraryDependencies += "dev.i10416" %% "cssminifier" % "0.0.2"
```For JS or Native platform, use `%%%` instead of `%%`.
```scala
libraryDependencies += "dev.i10416" %%% "cssminifier" % "0.0.2"
```## Run
```scala
import dev.i10416.CSSMinifierCSSMinifier.run("")
```## How to contribute?
- Give it a starβ
- Drop the feedback to the author @i10416
- Send a PR with fixes of typos/bugs/etcπ## License
Licensed under the Apache License, Version 2.0.