Giter Club home page Giter Club logo

itcss_cli's Introduction

Installation

Add this line to your application's Gemfile:

gem 'itcss_cli'

And then execute:

$ bundle

Or install it yourself as:

$ gem install itcss_cli

Usage

First, you'll need to set up ITCSS by running:

$ itcss init

Now go to itcss.yml and define define where Itcss_cli should create the ITCSS structure and the name of it's base file:

# Provide the root folder where the ITCSS file structure should be built.
stylesheets_directory: 'source/assets/stylesheets'

# Provide your base sass file (all ITCSS modules will be imported in it).
stylesheets_import_file: 'application.css'

Go ahead and grow your ITCSS structure:

$ itcss new component modals
create source/stylesheets/components/_components.modals.sass
update source/stylesheets/application.css.sass

$ itcss new trumps helpers
create source/stylesheets/trumps/_trumps.helpers.sass
update source/stylesheets/application.css.sass

Example

Creating a full ITCSS structure:

$ itcss init
create itcss.yml
Well done! Please do your own configurations in itcss.yml.

[[[ Open the `itcss.yml` file and edit it. ]]]

$ itcss install example
create source/stylesheets/settings/_settings.example.sass
create source/stylesheets/tools/_tools.example.sass
create source/stylesheets/generic/_generic.example.sass
create source/stylesheets/base/_base.example.sass
create source/stylesheets/objects/_objects.example.sass
create source/stylesheets/components/_components.example.sass
create source/stylesheets/trumps/_trumps.example.sass
update source/stylesheets/application.css.sass

If you open the ITCSS's base file now, you'll see that all ITCSS modules are automatically imported into it:

@charset "utf-8"

// ========================================
//   application.css.sass
// ========================================


// [0] Requirements --- Vendor libraries
// [1] Settings ------- Sass vars, etc.
// [2] Tools ---------- Functions and mixins.
// [3] Generic -------- Generic, high-level styling, like resets, etc.
// [4] Base ----------- Unclasses HTML elements (e.g. `h2`, `ul`).
// [5] Objects -------- Objects and abstractions.
// [6] Components ----- Your designed UI elements (inuitcss includes none of these).
// [7] Trumps --------- Overrides and helper classes.

// ↓ ITCSS_CLI FILE IMPORTING ↓

// [0] Settings
@import "settings/_settings.example.sass"


// [1] Tools
@import "tools/_tools.example.sass"


// [2] Generic
@import "generic/_generic.example.sass"


// [3] Base
@import "base/_base.example.sass"


// [4] Objects
@import "objects/_objects.example.sass"


// [5] Components
@import "components/_components.example.sass"


// [6] Trumps
@import "trumps/_trumps.example.sass"


// ↑ ITCSS_CLI FILE IMPORTING ↑

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/itcss_cli. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

itcss_cli's People

Contributors

kandebonfim avatar

Watchers

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