Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/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
https://github.com/sustainable-rails/tachyonscss-rails
css rails tachyons-sass
Last synced: about 1 month ago
JSON representation
Wraps tachyons-sass in a RubyGem suitable for the asset pipeline, now that it's made a comeback in Rails 7
- Host: GitHub
- URL: https://github.com/sustainable-rails/tachyonscss-rails
- Owner: sustainable-rails
- License: other
- Created: 2021-09-26T21:08:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-23T17:29:43.000Z (almost 3 years ago)
- Last Synced: 2024-09-27T16:21:33.629Z (about 2 months ago)
- Topics: css, rails, tachyons-sass
- Language: SCSS
- Homepage:
- Size: 46.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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](https://tachyons.io) without having to set up a JS bundler in your Rails 7 app.## Install
Add to your `Gemfile`:
```ruby
gem "tachyonscss-rails"
```then `bundle install`
## Use
The most common way to use this is:
1. Ensure you have `sassc-rails` in your `Gemfile`
1. 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.
1. Add to `app/assets/stylesheets/applicationscss`:```scss
@import "tachyons";
```
1. If you want to customize Tachyons, [the variables partial](https://github.com/tachyons-css/tachyons-sass/blob/master/scss/_variables.scss) 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:```scss
$green: 00ff00;
```
Then add it *before* the tachyons `@import` in `app/assets/stylesheets/application.scss:```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](https://github.com/tachyons-css/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.