All Projects → madeleineostoja → Rucksack

madeleineostoja / Rucksack

Licence: other
A little bag of CSS superpowers, built on PostCSS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Rucksack

Postcss Cssnext
`postcss-cssnext` has been deprecated in favor of `postcss-preset-env`.
Stars: ✭ 5,388 (+189.52%)
Mutual labels:  postcss, postcss-plugins
Postcss At Rules Variables
PostCss plugin to use CSS Custom Properties in at-rule @each, @for, @if, @else and more...
Stars: ✭ 52 (-97.21%)
Mutual labels:  postcss, postcss-plugins
Postcss Start To End
PostCSS plugin that lets you control your layout (LTR or RTL) through logical rather than physical rules
Stars: ✭ 18 (-99.03%)
Mutual labels:  postcss, postcss-plugins
sircus
Flexible Modular CSS Family for Designing in the Browser.
Stars: ✭ 19 (-98.98%)
Mutual labels:  postcss, css-framework
Tailwindcss
A utility-first CSS framework for rapid UI development.
Stars: ✭ 50,879 (+2633.96%)
Mutual labels:  css-framework, postcss
Postcss Utilities
PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS
Stars: ✭ 293 (-84.26%)
Mutual labels:  postcss, postcss-plugins
Postcss Selector Not
PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to more compatible CSS (multiple css3 :not() selectors)
Stars: ✭ 49 (-97.37%)
Mutual labels:  postcss, postcss-plugins
laggard
Automatically generate CSS fallbacks for legacy browsers, built on PostCSS
Stars: ✭ 23 (-98.76%)
Mutual labels:  postcss, postcss-plugins
Postcss Plugins
The "officially unofficial" consolidated list of PostCSS plugins in a ready-to-use package
Stars: ✭ 107 (-94.25%)
Mutual labels:  postcss, postcss-plugins
Postcss Font Family System Ui
PostCSS plugin to transform W3C CSS font-family: system-ui to a practical font-family list
Stars: ✭ 91 (-95.11%)
Mutual labels:  postcss, postcss-plugins
react-cli
基于 create-react-app 搭建的前端脚手架
Stars: ✭ 18 (-99.03%)
Mutual labels:  postcss, postcss-plugins
Postcss Instagram
📷 PostCSS plugin for using Instagram filters in CSS
Stars: ✭ 111 (-94.04%)
Mutual labels:  postcss, postcss-plugins
fortune
🔮Fortune is your friendly CSS properties framework.
Stars: ✭ 16 (-99.14%)
Mutual labels:  postcss, css-framework
Daisyui
⭐️ ⭐️ ⭐️ ⭐️ ⭐️  Tailwind Components
Stars: ✭ 382 (-79.47%)
Mutual labels:  css-framework, postcss
postcss-gtk
Processes GTK+ CSS into browser CSS
Stars: ✭ 23 (-98.76%)
Mutual labels:  postcss, postcss-plugins
Stencil Postcss
Autoprefixer plugin for Stencil
Stars: ✭ 19 (-98.98%)
Mutual labels:  postcss, postcss-plugins
postcss-if-media
A PostCSS plugin to inline or nest media queries within CSS rules & properties.
Stars: ✭ 35 (-98.12%)
Mutual labels:  postcss, postcss-plugins
postcss-responsive-font
Simple PostCSS plugin for creating responsive font sizes
Stars: ✭ 28 (-98.5%)
Mutual labels:  postcss, responsive-typography
Minna Ui
😸 A fast, friendly, and fun web UI kit for everyone.
Stars: ✭ 86 (-95.38%)
Mutual labels:  css-framework, postcss
Postcss High Contrast
Create high contrast version of your project with ease.
Stars: ✭ 108 (-94.2%)
Mutual labels:  postcss, postcss-plugins

rucksack logo

Build satus Downloads NPM version

ℹ️ Rucksack has a successor!
Satchel is thew new Rucksack, built on CSS-in-JS

A little bag of CSS superpowers, built on PostCSS.

Rucksack makes CSS development less painful, with the features and shortcuts it should have come with out of the box.

Read the full docs at rucksackcss.org/docs

Contents

Install

Rucksack is available on NPM under rucksack-css

$ npm i rucksack-css -D

Features

Responsive typography

Automagical fluid typography with new responsive arguments to font-size, line-height, and letter-spacing properties

.foo {
  font-size: responsive;
}

Responsive Type Demo

Shorthand positioning syntax

Use the shorthand syntax from margin and padding on position properties

.foo {
  position: absolute 0 20px;
}

Native clearfix

Generate bulletproof clearfixes with a new argument on the clear property

.foo {
  clear: fix;
}

Automatic font src generation

Automatically generate src sets for @font-face based on the path to your font files

@font-face {
  font-family: 'My Font';
  font-path: '/path/to/font/file';
}

Extra input pseudo-elements

Standardize the unweidly <input type="range"> element across browsers with new ::track and ::thumb pseudo elements

input[type="range"]::track {
  height: 2px;
}

Hex shortcuts for RGBA

Generate RGBA colors from a hex color + alpha value

.foo {
  color: rgba(#fff, 0.8);
}

More easing functions

Use a whole library of modern easing functions in transitions and animations

.foo {
  transition: all 250ms ease-out-cubic;
}

Quantity pseudo-selectors

Create truly responsive designs with powerful content quantity selectors

li:at-least(4) {
  color: blue;
}

li:between(4,6) {
  color: red;
}

Addons

Autoprefixer

Automatically apply vendor prefixes to relevant properties based on data from CanIUse, via autoprefixer.

Legacy Fallbacks

Automatically generate CSS fallbacks for legacy browsers, via laggard.

Usage

Rucksack is built on PostCSS, and can be used in most build tools and stacks easily.

Gulp

Use gulp-postcss

const gulp = require('gulp');
const postcss = require('gulp-postcss');
const rucksack = require('rucksack-css');

gulp.task('rucksack', () => {
  return gulp.src('src/*.css')
    .pipe(postcss([ rucksack() ]))
    .pipe(gulp.dest('dist'));
});

Webpack

Use postcss-loader

postcss.config.js

module.exports = {
  plugins: {
    'rucksack-css': {},
  }
};

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [ 'style-loader', 'postcss-loader' ]
      }
    ]
  }
};

Grunt

Use grunt-postcss

grunt.initConfig({
  postcss: {
    options: {
      processors: [
        require('rucksack-css')()
      ]
    },
    dist: {
      src: 'css/*.css'
    }
  }
});

CLI

Use Rucksack on the command line with postcss-cli

$ npm i postcss-cli -g

postcss.config.js

module.exports = {
  use: [ 'rucksack-css' ]
};
$ postcss "input.css" -o 'output.css'

Note: Rucksack currently ships with its own CLI tool, this will be deprecated in favor of using the more powerful PostCSS CLI directly in Rucksack 2

Javascript API

Since Rucksack is just a PostCSS plugin, you can also use it in JS/Node directly, via the PostCSS API

const postcss = require('postcss');
const rucksack = require('rucksack-css');

postcss([ rucksack() ])
  .process(css, { from: 'src/style.css', to: 'style.css' })
  .then(result => {
      fs.writeFileSync('style.css', result.css);
      if ( result.map ) fs.writeFileSync('style.css.map', result.map);
  });

See the PostCSS Docs for examples for your environment.

Stylus

Rucksack can be used as a Stylus plugin with PostStylus

stylus(css).use(poststylus('rucksack-css'))

See the PostStylus Docs for more examples for your environment.

Options

All features in Rucksack can be toggled by passing options on initialization. By default core features are set to true, and optional addons are set to false

Option Type Default Description
responsiveType Boolean true Whether to enable responsive typography
shorthandPosition Boolean true Whether to enable shorthand position properties
quantityQueries Boolean true Whether to enable quantity query pseudo selectors
inputPseudo Boolean true Whether to enable whether to enable extra input pseudo elements
clearFix Boolean true Whether to enable native clear fix
fontPath Boolean true Whether to enable font src set generation
hexRGBA Boolean true Whether to enable hex RGBA shortcuts
easings Boolean true Whether to enable extra easing functions
fallbacks Boolean false Whether to enable CSS fallbacks addon
autoprefixer Boolean false Whether to enable autoprefixer addon
reporter Boolean false Whether to enable error reporting from plugins used inside Rucksack

MIT © Madeleine Ostoja

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].