Skip to content

v4.0.0 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
inuit-rails
===========

An attempt to get inuit css framework to play nicely with rails.
Compiling inuitcss with Rails Sprockets + some extra great stuff!

It is strategy #2 in this useful blog post: http://www.codefellows.org/blog/five-ways-to-manage-front-end-assets-in-rails
Configuration
--------------

Of all the options, I wanted to have a way of keeping control over how and when I update the framework, whilst keeping bower out of my main rails app. This is the compromise that I came up with.
For a working example take a look in `example/main.scss`

Using inuit-rails
-----------------
The 'vanilla inuit' modules within `inuitcss/` and `csswizardry/` must be imported in the following order

I've tried to bring in pretty much all of the components on the inuit github page https://github.com/inuitcss; but the whole point of it is that you only bring in the parts that you need.
1. Settings
2. Tools
3. Generic
4. Base
5. Objects
6. Components
7. Trumps

Therefore on the Rails side, create a sass/scss file somewhere in your app/assets/stylesheets folder, which does the importing of just the modules you need. E.g.
E.G.

```
```scss
@import "inuit-defaults/settings.defaults";

@import "inuit-functions/tools.functions";
Expand All @@ -29,12 +35,26 @@ Therefore on the Rails side, create a sass/scss file somewhere in your app/asset
// Objects would go next...
```

I couldn't really get this to play nicely with the extensive use of variables, unless I import the stylesheets from the main app. To set a button colour for instance, you can add a variable before the part of the framework that you are importing, e.g.
For help using the additional wegotcoders modules (recommended), please RTFM at https://wegotcoders.github.io/inuit-rails/

```
$inuit-btn-background: #09992a;
@import "inuit-buttons/objects.buttons";
```
About
-----

This gem combines all of the repos on the new inuitcss github page
https://github.com/inuitcss.

A few of the files here have been included from the older inuitcss repo at
https://github.com/csswizardry/inuit.css/ since they are not yet covered by the
newest version. These are located in `csswizardy/`.

Some custom inuit-esque files are located in `wegotcoders/modified_inuit_css/`.
The syntax here has been adapted for improved 'guessability'. In addition each
class has been coupled to all of the breakpoints.

Some extra helper files, including a color palette, are located in
`wegotcoders/wgc_add_ons/`. These can be useful
for customising elements beyond the basic macros of the inuitcss
classes.

Contributing to inuit-rails
---------------------------
Expand All @@ -44,5 +64,4 @@ Contributing to inuit-rails
* Fork the project.
* Start a feature/bugfix branch.
* Commit and push until you are happy with your contribution.
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
4.0.0
135 changes: 135 additions & 0 deletions example/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/* *\
Set vanilla inuitcss variables
\* */

$inuit-enable-btn--small: true;
$inuit-enable-btn--large: true;
$inuit-enable-btn--full: true;
$inuit-enable-btn--pill: true;

/* *\
Set wegotcoders variables
\* */

$wgc-breakpoints: (
(
breakpoint-scope: 'palm',
breakpoint-condition: 'screen and (max-width: 44.9375em)'
),
(
breakpoint-scope: 'lap-and-up',
breakpoint-condition: 'screen and (min-width: 45em)'
),
(
breakpoint-scope: 'desk',
breakpoint-condition: 'screen and (min-width: 64em)'
)
);

$main-breakpoints: ('palm', 'lap-and-up', 'desk');

$wgc-allowed-breakpoints-for-guttering-option--flush: $main-breakpoints;
$wgc-allowed-breakpoints-for-guttering-option--one-quarter-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-guttering-option--one-half-bsu: ('lap-and-up');
$wgc-allowed-breakpoints-for-guttering-option--one-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-guttering-option--two-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-guttering-option--four-bsu: ('desk');

$wgc-allowed-breakpoints-for-column-group-wholes: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-halves: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-thirds: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-quarters: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-fifths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-sixths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-sevenths: ('palm', 'lap-and-up');
$wgc-allowed-breakpoints-for-column-group-eighths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-ninths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-tenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-elevenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-twelfths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-thirteenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-fourteenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-fifteenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-sixteenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-seventeenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-eighteenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-nineteenths: $main-breakpoints;
$wgc-allowed-breakpoints-for-column-group-twentieths: ('palm');

$wgc-allowed-breakpoints-for-paddings--none: $main-breakpoints;
$wgc-allowed-breakpoints-for-paddings--one-quarter-bsu: ('lap-and-up');
$wgc-allowed-breakpoints-for-paddings--one-half-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-paddings--one-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-paddings--two-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-paddings--four-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-margins--none: $main-breakpoints;
$wgc-allowed-breakpoints-for-margins--one-quarter-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-margins--one-half-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-margins--one-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-margins--two-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-margins--four-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-negative-margins--one-quarter-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-negative-margins--one-half-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-negative-margins--one-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-negative-margins--two-bsu: $main-breakpoints;
$wgc-allowed-breakpoints-for-negative-margins--four-bsu: $main-breakpoints;

$wgc-allowed-breakpoints-for-layout-helpers: $main-breakpoints;
$wgc-allowed-breakpoints-for-colours: $main-breakpoints;
$wgc-allowed-breakpoints-for-borders: $main-breakpoints;
$wgc-allowed-breakpoints-for-lists: $main-breakpoints;
$wgc-allowed-breakpoints-for-typography: $main-breakpoints;

/* *\
Import vanilla inuitcss modules
\* */

@import
'inuitcss/inuit-defaults/settings.defaults',
'inuitcss/inuit-mixins/tools.mixins',
'inuitcss/inuit-functions/tools.functions',
'inuitcss/inuit-normalize/generic.normalize',
'inuitcss/inuit-box-sizing/generic.box-sizing',
'inuitcss/inuit-list-inline/objects.list-inline',
'inuitcss/inuit-buttons/objects.buttons',
'inuitcss/inuit-clearfix/trumps.clearfix'
;

/* *\
Import css_wizardy modules
\* */

@import
'css_wizardy/generic.shared',
'css_wizardy/base.forms',
'css_wizardy/objects.flyout'
;

/* *\
Import wegotcoders modules
\* */

/* The order here:
'wegotcoders/wgc_config',

'wegotcoders/modified_inuit_css/breakpoints',
'wegotcoders/modified_inuit_css/functions',

is crucial!
*/

@import
'wegotcoders/wgc_config',

'wegotcoders/modified_inuit_css/breakpoints',
'wegotcoders/modified_inuit_css/functions',
'wegotcoders/modified_inuit_css/layout_groups',
'wegotcoders/modified_inuit_css/columns',
'wegotcoders/modified_inuit_css/box_model',

'wegotcoders/wgc_add_ons/layout_helpers',
'wegotcoders/wgc_add_ons/borders',
'wegotcoders/wgc_add_ons/colours',
'wegotcoders/wgc_add_ons/lists',
'wegotcoders/wgc_add_ons/typography'
;
4 changes: 3 additions & 1 deletion lib/inuit-rails/rails/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ module Rails
class Engine < ::Rails::Engine
end
end
end

VERSION = '4.0.0'.freeze
end
85 changes: 85 additions & 0 deletions vendor/assets/stylesheets/wegotcoders/_wgc_config.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
$wgc-breakpoints: (
(
breakpoint-scope: 'all-devices',
breakpoint-condition: 'screen and (min-width: 0em)'
),
(
breakpoint-scope: 'palm',
breakpoint-condition: 'screen and (max-width: 44.9375em)'
),
(
breakpoint-scope: 'lap',
breakpoint-condition: 'screen and (min-width: 45em) and (max-width: 63.9375em)'
),
(
breakpoint-scope: 'lap-and-up',
breakpoint-condition: 'screen and (min-width: 45em)'
),
(
breakpoint-scope: 'portable',
breakpoint-condition: 'screen and (max-width: 63.9375em)'
),
(
breakpoint-scope: 'desk',
breakpoint-condition: 'screen and (min-width: 64em)'
)
) !default;

$wgc-bsu: 24px !default;
$wgc-base-text-color: #333333 !default;
$wgc-base-background-color: #FFFFFF !default;
$wgc-namespace: 'wgc' !default;

$wgc-border-radius: 3px !default;

$wgc-allowed-breakpoints-for-guttering-option--flush: () !default;
$wgc-allowed-breakpoints-for-guttering-option--one-quarter-bsu: () !default;
$wgc-allowed-breakpoints-for-guttering-option--one-half-bsu: () !default;
$wgc-allowed-breakpoints-for-guttering-option--one-bsu: () !default;
$wgc-allowed-breakpoints-for-guttering-option--two-bsu: () !default;
$wgc-allowed-breakpoints-for-guttering-option--four-bsu: () !default;

$wgc-allowed-breakpoints-for-column-group-wholes: () !default;
$wgc-allowed-breakpoints-for-column-group-halves: () !default;
$wgc-allowed-breakpoints-for-column-group-thirds: () !default;
$wgc-allowed-breakpoints-for-column-group-quarters: () !default;
$wgc-allowed-breakpoints-for-column-group-fifths: () !default;
$wgc-allowed-breakpoints-for-column-group-sixths: () !default;
$wgc-allowed-breakpoints-for-column-group-sevenths: () !default;
$wgc-allowed-breakpoints-for-column-group-eighths: () !default;
$wgc-allowed-breakpoints-for-column-group-ninths: () !default;
$wgc-allowed-breakpoints-for-column-group-tenths: () !default;
$wgc-allowed-breakpoints-for-column-group-elevenths: () !default;
$wgc-allowed-breakpoints-for-column-group-twelfths: () !default;
$wgc-allowed-breakpoints-for-column-group-thirteenths: () !default;
$wgc-allowed-breakpoints-for-column-group-fourteenths: () !default;
$wgc-allowed-breakpoints-for-column-group-fifteenths: () !default;
$wgc-allowed-breakpoints-for-column-group-sixteenths: () !default;
$wgc-allowed-breakpoints-for-column-group-seventeenths: () !default;
$wgc-allowed-breakpoints-for-column-group-eighteenths: () !default;
$wgc-allowed-breakpoints-for-column-group-nineteenths: () !default;
$wgc-allowed-breakpoints-for-column-group-twentieths: () !default;

$wgc-allowed-breakpoints-for-paddings--none: () !default;
$wgc-allowed-breakpoints-for-paddings--one-quarter-bsu: () !default;
$wgc-allowed-breakpoints-for-paddings--one-half-bsu: () !default;
$wgc-allowed-breakpoints-for-paddings--one-bsu: () !default;
$wgc-allowed-breakpoints-for-paddings--two-bsu: () !default;
$wgc-allowed-breakpoints-for-paddings--four-bsu: () !default;
$wgc-allowed-breakpoints-for-margins--none: () !default;
$wgc-allowed-breakpoints-for-margins--one-quarter-bsu: () !default;
$wgc-allowed-breakpoints-for-margins--one-half-bsu: () !default;
$wgc-allowed-breakpoints-for-margins--one-bsu: () !default;
$wgc-allowed-breakpoints-for-margins--two-bsu: () !default;
$wgc-allowed-breakpoints-for-margins--four-bsu: () !default;
$wgc-allowed-breakpoints-for-negative-margins--one-quarter-bsu: () !default;
$wgc-allowed-breakpoints-for-negative-margins--one-half-bsu: () !default;
$wgc-allowed-breakpoints-for-negative-margins--one-bsu: () !default;
$wgc-allowed-breakpoints-for-negative-margins--two-bsu: () !default;
$wgc-allowed-breakpoints-for-negative-margins--four-bsu: () !default;

$wgc-allowed-breakpoints-for-layout-helpers: () !default;
$wgc-allowed-breakpoints-for-colours: () !default;
$wgc-allowed-breakpoints-for-borders: () !default;
$wgc-allowed-breakpoints-for-lists: () !default;
$wgc-allowed-breakpoints-for-typography: () !default;
Loading