sustainable-rails / tachyonscss-rails

Wraps tachyons-sass in a RubyGem suitable for the asset pipeline, now that it's made a comeback in Rails 7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tachyonscss-rails - Use Tachyons in a Rails App without NPM Modules

Rails 7 has brought the Asset Pipeline back into the spotlight, which means that bundling CSS without NPM requires gems. This gem allows you to use Tachyons without having to set up a JS bundler in your Rails 7 app.

Install

Add to your Gemfile:

gem "tachyonscss-rails"

then bundle install

Use

The most common way to use this is:

  1. Ensure you have sassc-rails in your Gemfile

  2. Ensure your app/assets/stylesheets/application.scss file is, in fact, a .scss file and not .css. If you haven't put anything in it, you can rename it safely.

  3. Add to app/assets/stylesheets/applicationscss:

    @import "tachyons";
  4. If you want to customize Tachyons, the variables partial is a guide to what you can modify. To do that, create the file app/assets/stylesheets/tachyons-overrides.scss (or whatever name you like). For example, you could change the green skin like so:

    $green: 00ff00;

    Then add it before the tachyons @import in `app/assets/stylesheets/application.scss:

    @import "tachyons-overrides";
    @import "tachyons";

Basically, this gem makes it so you can @import "tachyons"; and it will build the CSS file from the contents of the tachyons-sass module that this gem wraps.

Versions

The version of this gem matches the version of tachyons it bundles, except that it's possible for this gem to bundle an unreleased version of Tachyons. In that case, the gem will use a fourth number, for example 4.9.0.1 would indicate that this is the first release beyond 4.9.0 to include Tachyons code added to its main branch since 4.9.0 was released.

About

Wraps tachyons-sass in a RubyGem suitable for the asset pipeline, now that it's made a comeback in Rails 7

License:Other


Languages

Language:SCSS 98.2%Language:Ruby 1.7%Language:Shell 0.1%