Coder Social home page Coder Social logo

picnic-rails's Introduction

Picnic for Rails

Installation

picnic-rails is easy to drop into Rails with the asset pipeline.

In your Gemfile you need to add the picnic-rails gem, and ensure that the sass-rails gem is present - it is added to new Rails applications by default.

gem 'picnic-rails'

It is also recommended to use Autoprefixer with Picnic to add browser vendor prefixes automatically. Simply add the gem:

gem 'autoprefixer-rails'

bundle install and restart your server to make the files available through the pipeline.

Import Picnic styles in app/assets/stylesheets/application.css.scss:

@import 'picinc';

Make sure the file has .css.scss extension (or .css.sass for Sass syntax). If you have just generated a new Rails app, it may come with a .css file instead. If this file exists, it will be served instead of Sass, so remove it:

$ rm app/assets/stylesheets/application.css

Do not use //= require in Sass or your other stylesheets will not be [able to access][antirequire] the Picinc variables.

  • You can include all modules separately. List of all available modules is here. It is required to include variables first.
@import 'picinc/variables';
@import 'picinc/checkbox';
@import 'picinc/select';

Configuration

Sass

Sass: Autoprefixer

Using [Autoprefixer][autoprefixer] with Picnic is recommended. [Autoprefixer][autoprefixer] adds vendor prefixes to CSS rules using values from Can I Use.

Usage

Sass

The full list of Picinc variables can be found here. You can override these by simply redefining the variable before the @import directive, e.g.:

$picnic-deep: true;
$picnic-tablet-width: 750px;
$picnic-laptop-width: 1200px;
$picnic-success: green;

@import 'picinc';

You're in good company

picinc autoprefixer

picnic-rails's People

Contributors

galulex avatar

Watchers

Joe Marty avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.