All Projects → madyankin → postcss-each

madyankin / postcss-each

Licence: MIT License
PostCSS plugin to iterate through values

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to postcss-each

caesura
📏 A reasonable breakpoint scale using @Custom-Media
Stars: ✭ 14 (-84.95%)
Mutual labels:  postcss
Webpack-Starter-Kit
Webpack 4 stater kit with SCSS, PostCSS, Babel & ESLint
Stars: ✭ 41 (-55.91%)
Mutual labels:  postcss
pywedge
Makes Interactive Chart Widget, Cleans raw data, Runs baseline models, Interactive hyperparameter tuning & tracking
Stars: ✭ 49 (-47.31%)
Mutual labels:  preprocessing
veridical-flow
Making it easier to build stable, trustworthy data-science pipelines.
Stars: ✭ 28 (-69.89%)
Mutual labels:  preprocessing
queueable
Convert streams to async ⌛ iterables ➰
Stars: ✭ 43 (-53.76%)
Mutual labels:  iteration
tweets-preprocessor
Repo containing the Twitter preprocessor module, developed by the AUTH OSWinds team
Stars: ✭ 26 (-72.04%)
Mutual labels:  preprocessing
tailwind-bootstrap-grid
Tailwind CSS plugin that generates Bootstrap's flexbox grid
Stars: ✭ 96 (+3.23%)
Mutual labels:  postcss
dropEst
Pipeline for initial analysis of droplet-based single-cell RNA-seq data
Stars: ✭ 71 (-23.66%)
Mutual labels:  preprocessing
postcss-relaxed-unit
🍮Postcss-relaxed-unit is a postcss plugin for unit tranformation and make write css easier with custom unit.
Stars: ✭ 44 (-52.69%)
Mutual labels:  postcss
quantum-blox
Quantum blox - modular UI boilerplate in react
Stars: ✭ 12 (-87.1%)
Mutual labels:  postcss
postcss-shopify-settings-variables
PostCSS plugin for variable of theme setting in shopify css file.
Stars: ✭ 14 (-84.95%)
Mutual labels:  postcss
postcss-combine-duplicated-selectors
automatically keep css selectors unique.
Stars: ✭ 69 (-25.81%)
Mutual labels:  postcss
skippa
SciKIt-learn Pipeline in PAndas
Stars: ✭ 33 (-64.52%)
Mutual labels:  preprocessing
hugo-starter-tailwind-basic
A basic and simple to set up Hugo with TailwindCSS starter project.
Stars: ✭ 80 (-13.98%)
Mutual labels:  postcss
sircus
Flexible Modular CSS Family for Designing in the Browser.
Stars: ✭ 19 (-79.57%)
Mutual labels:  postcss
building-realworld-user-interfaces-using-tailwind
Demo of building real-world UIs using TailwindCSS
Stars: ✭ 87 (-6.45%)
Mutual labels:  postcss
postcss-image-set-polyfill
PostCSS plugin for polyfilling image-set CSS function
Stars: ✭ 45 (-51.61%)
Mutual labels:  postcss
BrainPrep
Preprocessing pipeline on Brain MR Images through FSL and ANTs, including registration, skull-stripping, bias field correction, enhancement and segmentation.
Stars: ✭ 107 (+15.05%)
Mutual labels:  preprocessing
postcss-inline-base64
PostCSS plugin used to replace value inside of url function to base64
Stars: ✭ 23 (-75.27%)
Mutual labels:  postcss
soba
Kirby starter theme that uses Twig, PostCSS, and Browsersync
Stars: ✭ 16 (-82.8%)
Mutual labels:  postcss

postcss-each

A PostCSS plugin to iterate through values.

Iterate through values:

@each $icon in foo, bar, baz {
  .icon-$(icon) {
    background: url('icons/$(icon).png');
  }
}
.icon-foo {
  background: url('icons/foo.png');
}

.icon-bar {
  background: url('icons/bar.png');
}

.icon-baz {
  background: url('icons/baz.png');
}

Iterate through values with index:

@each $val, $i in foo, bar {
  .icon-$(val) {
    background: url("$(val)_$(i).png");
  }
}
.icon-foo {
  background: url("foo_0.png");
}

.icon-bar {
  background: url("bar_1.png");
}

Iterate through multiple variables:

@each $animal, $color in (puma, sea-slug), (black, blue) {
  .$(animal)-icon {
    background-image: url('/images/$(animal).png');
    border: 2px solid $color;
  }
}
.puma-icon {
  background-image: url('/images/puma.png');
  border: 2px solid black;
}
.sea-slug-icon {
  background-image: url('/images/sea-slug.png');
  border: 2px solid blue;
}

Installation

npm install --save-dev postcss postcss-each

Usage

postcss([ require('postcss-each') ])

Options

plugins

Type: object
Default: {}

Accepts two properties: afterEach and beforeEach

afterEach

Type: array Default: []

Plugins to be called after each iteration

beforeEach

Type: array Default: []

Plugins to be called before each iteration

require('postcss-each')({
  plugins: {
    afterEach: [
      require('postcss-at-rules-variables')
    ],
    beforeEach: [
      require('postcss-custom-properties')
    ]
  }
})

See PostCSS docs for examples for your environment.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].