# gulp-css-scala

> Gulp Custom Plugin to convert style classes from css file into a scala object

Latest version **2.7.0** (published 2021-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-css-scala
pnpm add gulp-css-scala
yarn add gulp-css-scala
bun add gulp-css-scala
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.7.0 |
| Published | 2021-02-22 |
| First published | 2017-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 29.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Brandt |
| Maintainers | stevepflc |
| Keywords | gulpplugin, css, scala |

## Links

- npm: https://www.npmjs.com/package/gulp-css-scala
- Repository: https://github.com/SteveBrandt/gulp-css-scala
- Homepage: https://github.com/SteveBrandt/gulp-css-scala#readme
- Issues: https://github.com/SteveBrandt/gulp-css-scala/issues
- npm.io page: https://npm.io/package/gulp-css-scala

## Dependencies (2)

- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1
- [merge-options](https://npm.io/package/merge-options.md) ^1.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 2.7.0 (latest) — 2021-02-22
- 1.0.1 (beta) — 2017-03-31
- 2.6.0 — 2019-06-05
- 2.5.1 — 2019-02-12
- 2.4.1 — 2018-07-27
- 2.4.0 — 2018-07-27
- 2.3.1 — 2018-05-25
- 2.3.0 — 2018-05-25
- 2.2.3 — 2018-05-25
- 2.2.2 — 2018-05-25
- 2.2.1 — 2018-04-26
- 2.2.0 — 2018-03-06
- 2.1.0 — 2018-03-05
- 2.0.4 — 2017-06-07
- 2.0.3 — 2017-04-17
- … 7 more at https://npm.io/package/gulp-css-scala/versions

## README

# gulp-css-scala

[![Build Status](https://travis-ci.org/SteveBrandt/gulp-css-scala.svg?branch=master)](https://travis-ci.org/SteveBrandt/gulp-css-scala)

Gulp Custom Plugin to convert style classes from css file into a scala object


## Installation 

`npm install gulp-css-scala --save-dev`


## Usage

 Have alook at the example directory. 

```js
var rename = require('gulp-rename'),
    cssScala = require('gulp-css-scala');

gulp.task('default', function() {
    return gulp.src('style/foo.css').
        pipe(cssScala()).
        pipe(rename('Css.scala')).
        pipe(gulp.dest('dest'));
});
```

This will create a new `Css.scala` object in the directory `dest` from the given css file `foo.css`.
**Only style classes are considered.**

**Input (foo.css):**
```css
.foo {
    color: red;
}
.foo__bar {
    color: red;
}
.foo--bar {
    color: red;
}

```

**Output (Css.scala):**
```scala
package com.example.css

// File is generated by gulp-css-scala

object Css {
  val foo: String = "foo"
  val fooAsBar: String = "foo--bar"
  val fooChildBar: String = "foo__bar"
}
```


## Additional css style selectors

```js
gulp.task('default', function() {
    return gulp.src(['styles/*.css', 'additional-style-class-selectors.txt']).
        pipe(cssScala()).
        pipe(rename('Css.scala')).
        pipe(gulp.dest('dest'));
});
```

## Ignore css style selectors

```js
gulp.task('default', function() {
    return gulp.src(['styles/*.css']).
        pipe(cssScala({
            selectorsToIgnore: ['.foo-exclude .bar-exclude', '.bar-exclude']
        })).
        pipe(rename('Css.scala')).
        pipe(gulp.dest('dest'));
});
```


## Options

```js
cssScala({
    packageName: 'com.example.css', 
    objectName:  'Css',
    replaceForDashDash: 'As',
    replaceForUnderlineUnderline: 'Child',
    selectorsToIgnore: []
})
```

|Name|Description|Default|
|---|---|---|
|packageName|The name of the package of the generated object|com.example.css|
|objectName|The name of the generated object|Css|
|replaceForDashDash|replacement for -- in resulting property name|As|
|replaceForUnderlineUnderline|replacement for __ in resulting property name|Child|
|selectorsToIgnore|Define your selectors which should be **not** processed. Example: `selectorsToIgnore: ['.foo-exclude .bar-exclude', '.bar-exclude']`|[]|

---
_Source: https://npm.io/package/gulp-css-scala · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
