inuit-rails 6.0.0.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.bowerrc +3 -0
  3. data/.document +5 -0
  4. data/.gitignore +55 -0
  5. data/.rspec +2 -0
  6. data/.travis.yml +5 -0
  7. data/CODE_OF_CONDUCT.md +49 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +41 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +14 -0
  13. data/bin/setup +8 -0
  14. data/bower.json +19 -0
  15. data/inuit-rails.gemspec +24 -0
  16. data/lib/inuit-rails.rb +2 -0
  17. data/lib/inuit-rails/rails.rb +1 -0
  18. data/lib/inuit-rails/rails/engine.rb +6 -0
  19. data/lib/inuit-rails/rails/version.rb +5 -0
  20. data/vendor/assets/stylesheets/inuitcss/LICENSE +13 -0
  21. data/vendor/assets/stylesheets/inuitcss/circle.yml +17 -0
  22. data/vendor/assets/stylesheets/inuitcss/components/_example.components.buttons.scss +170 -0
  23. data/vendor/assets/stylesheets/inuitcss/elements/_elements.headings.scss +47 -0
  24. data/vendor/assets/stylesheets/inuitcss/elements/_elements.images.scss +28 -0
  25. data/vendor/assets/stylesheets/inuitcss/elements/_elements.page.scss +22 -0
  26. data/vendor/assets/stylesheets/inuitcss/elements/_elements.tables.scss +11 -0
  27. data/vendor/assets/stylesheets/inuitcss/example.main.scss +154 -0
  28. data/vendor/assets/stylesheets/inuitcss/generic/_generic.box-sizing.scss +22 -0
  29. data/vendor/assets/stylesheets/inuitcss/generic/_generic.normalize.scss +461 -0
  30. data/vendor/assets/stylesheets/inuitcss/generic/_generic.reset.scss +53 -0
  31. data/vendor/assets/stylesheets/inuitcss/generic/_generic.shared.scss +36 -0
  32. data/vendor/assets/stylesheets/inuitcss/objects/_objects.block.scss +63 -0
  33. data/vendor/assets/stylesheets/inuitcss/objects/_objects.box.scss +48 -0
  34. data/vendor/assets/stylesheets/inuitcss/objects/_objects.crop.scss +99 -0
  35. data/vendor/assets/stylesheets/inuitcss/objects/_objects.flag.scss +214 -0
  36. data/vendor/assets/stylesheets/inuitcss/objects/_objects.layout.scss +247 -0
  37. data/vendor/assets/stylesheets/inuitcss/objects/_objects.list-bare.scss +13 -0
  38. data/vendor/assets/stylesheets/inuitcss/objects/_objects.list-inline.scss +53 -0
  39. data/vendor/assets/stylesheets/inuitcss/objects/_objects.media.scss +152 -0
  40. data/vendor/assets/stylesheets/inuitcss/objects/_objects.pack.scss +90 -0
  41. data/vendor/assets/stylesheets/inuitcss/objects/_objects.ratio.scss +85 -0
  42. data/vendor/assets/stylesheets/inuitcss/objects/_objects.tables.scss +74 -0
  43. data/vendor/assets/stylesheets/inuitcss/objects/_objects.wrapper.scss +51 -0
  44. data/vendor/assets/stylesheets/inuitcss/settings/_example.settings.config.scss +24 -0
  45. data/vendor/assets/stylesheets/inuitcss/settings/_example.settings.global.scss +9 -0
  46. data/vendor/assets/stylesheets/inuitcss/settings/_settings.core.scss +93 -0
  47. data/vendor/assets/stylesheets/inuitcss/tools/_tools.clearfix.scss +19 -0
  48. data/vendor/assets/stylesheets/inuitcss/tools/_tools.font-size.scss +44 -0
  49. data/vendor/assets/stylesheets/inuitcss/tools/_tools.hidden.scss +15 -0
  50. data/vendor/assets/stylesheets/inuitcss/tools/_tools.rem.scss +48 -0
  51. data/vendor/assets/stylesheets/inuitcss/utilities/_utilities.clearfix.scss +11 -0
  52. data/vendor/assets/stylesheets/inuitcss/utilities/_utilities.headings.scss +36 -0
  53. data/vendor/assets/stylesheets/inuitcss/utilities/_utilities.hide.scss +21 -0
  54. data/vendor/assets/stylesheets/inuitcss/utilities/_utilities.print.scss +90 -0
  55. data/vendor/assets/stylesheets/inuitcss/utilities/_utilities.spacing.scss +57 -0
  56. data/vendor/assets/stylesheets/inuitcss/utilities/_utilities.widths.scss +167 -0
  57. data/vendor/assets/stylesheets/sass-mq/_mq.scss +287 -0
  58. data/vendor/assets/stylesheets/sass-mq/show-breakpoints.gif +0 -0
  59. metadata +144 -0
@@ -0,0 +1,44 @@
1
+ ///* ========================================================================
2
+ // #FONT-SIZE
3
+ // ======================================================================== */
4
+
5
+ // Generate a font-size and baseline-compatible line-height.
6
+ @mixin inuit-font-size($font-size, $line-height: auto, $important: false) {
7
+
8
+ @if (type-of($font-size) == number) {
9
+ @if (unit($font-size) != "px") {
10
+ @error "`#{$font-size}` needs to be a pixel value.";
11
+ }
12
+ } @else {
13
+ @error "`#{$font-size}` needs to be a number.";
14
+ }
15
+
16
+ @if ($important == true) {
17
+ $important: !important;
18
+ } @elseif ($important == false) {
19
+ $important: null;
20
+ } @else {
21
+ @error "`#{$important}` needs to be `true` or `false`."
22
+ }
23
+
24
+ // We provide a `px` fallback for old IEs not supporting `rem` values.
25
+ font-size: $font-size $important;
26
+ font-size: ($font-size / $inuit-global-font-size) * 1rem $important;
27
+
28
+ @if ($line-height == 'auto') {
29
+ line-height: ceil($font-size / $inuit-global-line-height) * ($inuit-global-line-height / $font-size) $important;
30
+ }
31
+
32
+ @else {
33
+
34
+ @if (type-of($line-height) == number or $line-height == 'inherit' or $line-height == 'normal') {
35
+ line-height: $line-height $important;
36
+ }
37
+
38
+ @elseif ($line-height != 'none' and $line-height != false) {
39
+ @error "D’oh! `#{$line-height}` is not a valid value for `$line-height`."
40
+ }
41
+
42
+ }
43
+
44
+ }
@@ -0,0 +1,15 @@
1
+ ///* ========================================================================
2
+ // #HIDDEN-VISUALLY
3
+ // ======================================================================== */
4
+
5
+ // Mixin to quickly apply accessible hiding to elements.
6
+ @mixin inuit-hidden-visually() {
7
+ border: 0 !important;
8
+ clip: rect(0 0 0 0) !important;
9
+ height: 1px !important;
10
+ margin: -1px !important;
11
+ overflow: hidden !important;
12
+ padding: 0 !important;
13
+ position: absolute !important;
14
+ width: 1px !important;
15
+ }
@@ -0,0 +1,48 @@
1
+ ///* ========================================================================
2
+ // #REM
3
+ // ======================================================================== */
4
+
5
+ // Convert any px value into its rem equivalent.
6
+
7
+ @function inuit-rem($value) {
8
+
9
+ @if (type-of($value) == number) {
10
+
11
+ @if (unit($value) != "px") {
12
+ @error "`#{$value}` needs to be a pixel value.";
13
+ }
14
+
15
+ } @else {
16
+ @error "`#{$value}` needs to be a number.";
17
+ }
18
+
19
+ @return $value / $inuit-global-font-size * 1rem;
20
+
21
+ }
22
+
23
+
24
+ // Mixin to create a declaration whose value is a rem unit. Also provide pixel
25
+ // fallback.
26
+ //
27
+ // .simple-usage {
28
+ // @include inuit-rem(padding, 10px);
29
+ // }
30
+
31
+ @mixin inuit-rem($property, $value) {
32
+
33
+ @if (type-of($value) == number) {
34
+
35
+ @if (unit($value) != "px") {
36
+ @error "`#{$value}` needs to be a pixel value.";
37
+ }
38
+
39
+ } @else {
40
+ @error "`#{$value}` needs to be a number.";
41
+ }
42
+
43
+ // We provide a `px` fallback for old IEs not supporting `rem` values.
44
+ #{$property}: $value;
45
+
46
+ #{$property}: inuit-rem($value);
47
+
48
+ }
@@ -0,0 +1,11 @@
1
+ /* ==========================================================================
2
+ #CLEARFIX
3
+ ========================================================================== */
4
+
5
+ /**
6
+ * Attach our clearfix mixin to a utility class.
7
+ */
8
+
9
+ .u-clearfix {
10
+ @include inuit-clearfix();
11
+ }
@@ -0,0 +1,36 @@
1
+ /* ==========================================================================
2
+ #HEADINGS
3
+ ========================================================================== */
4
+
5
+ /**
6
+ * Redefine all of our basic heading styles against utility classes so as to
7
+ * allow for double stranded heading hierarchy, e.g. we semantically need an H2,
8
+ * but we want it to be sized like an H1:
9
+ *
10
+ * <h2 class="u-h1"></h2>
11
+ *
12
+ */
13
+
14
+ .u-h1 {
15
+ @include inuit-font-size($inuit-font-size-h1, $important: true);
16
+ }
17
+
18
+ .u-h2 {
19
+ @include inuit-font-size($inuit-font-size-h2, $important: true);
20
+ }
21
+
22
+ .u-h3 {
23
+ @include inuit-font-size($inuit-font-size-h3, $important: true);
24
+ }
25
+
26
+ .u-h4 {
27
+ @include inuit-font-size($inuit-font-size-h4, $important: true);
28
+ }
29
+
30
+ .u-h5 {
31
+ @include inuit-font-size($inuit-font-size-h5, $important: true);
32
+ }
33
+
34
+ .u-h6 {
35
+ @include inuit-font-size($inuit-font-size-h6, $important: true);
36
+ }
@@ -0,0 +1,21 @@
1
+ /* ==========================================================================
2
+ #HIDE
3
+ ========================================================================== */
4
+
5
+ /**
6
+ * Hide only visually, but have it available for screen readers:
7
+ * http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
8
+ */
9
+
10
+ .u-hidden-visually {
11
+ @include inuit-hidden-visually();
12
+ }
13
+
14
+
15
+ /**
16
+ * Hide visually and from screen readers.
17
+ */
18
+
19
+ .u-hidden {
20
+ display: none !important;
21
+ }
@@ -0,0 +1,90 @@
1
+ /* ==========================================================================
2
+ #PRINT
3
+ ========================================================================== */
4
+
5
+ /**
6
+ * Very crude, reset-like styles taken from the HTML5 Boilerplate:
7
+ * https://github.com/h5bp/html5-boilerplate/blob/5.3.0/dist/doc/css.md#print-styles
8
+ * https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css#L205-L282
9
+ */
10
+
11
+ @media print {
12
+
13
+ /**
14
+ * 1. Black prints faster: http://www.sanbeiji.com/archives/953
15
+ */
16
+
17
+ *,
18
+ *:before,
19
+ *:after,
20
+ *:first-letter,
21
+ *:first-line {
22
+ background: transparent !important;
23
+ color: #000 !important; /* [1] */
24
+ box-shadow: none !important;
25
+ text-shadow: none !important;
26
+ }
27
+
28
+
29
+ a,
30
+ a:visited {
31
+ text-decoration: underline;
32
+ }
33
+
34
+ a[href]:after {
35
+ content: " (" attr(href) ")";
36
+ }
37
+
38
+ abbr[title]:after {
39
+ content: " (" attr(title) ")";
40
+ }
41
+
42
+
43
+ /**
44
+ * Don't show links that are fragment identifiers, or use the `javascript:`
45
+ * pseudo protocol.
46
+ */
47
+
48
+ a[href^="#"]:after,
49
+ a[href^="javascript:"]:after {
50
+ content: "";
51
+ }
52
+
53
+ pre,
54
+ blockquote {
55
+ border: 1px solid #999;
56
+ page-break-inside: avoid;
57
+ }
58
+
59
+
60
+ /**
61
+ * Printing Tables: http://css-discuss.incutio.com/wiki/Printing_Tables
62
+ */
63
+
64
+ thead {
65
+ display: table-header-group;
66
+ }
67
+
68
+ tr,
69
+ img {
70
+ page-break-inside: avoid;
71
+ }
72
+
73
+
74
+ img {
75
+ max-width: 100% !important;
76
+ }
77
+
78
+ p,
79
+ h2,
80
+ h3 {
81
+ orphans: 3;
82
+ widows: 3;
83
+ }
84
+
85
+ h2,
86
+ h3 {
87
+ page-break-after: avoid;
88
+ }
89
+
90
+ }
@@ -0,0 +1,57 @@
1
+ /* ==========================================================================
2
+ #SPACING
3
+ ========================================================================== */
4
+
5
+ /**
6
+ * Utility classes to put specific spacing values onto elements. The below loop
7
+ * will generate us a suite of classes like:
8
+ *
9
+ * .u-margin-top {}
10
+ * .u-padding-left-large {}
11
+ * .u-margin-right-small {}
12
+ * .u-padding {}
13
+ * .u-padding-right-none {}
14
+ */
15
+
16
+ /* stylelint-disable string-quotes */
17
+
18
+ $inuit-spacing-directions: (
19
+ null: null,
20
+ '-top': '-top',
21
+ '-right': '-right',
22
+ '-bottom': '-bottom',
23
+ '-left': '-left',
24
+ ) !default;
25
+
26
+ $inuit-spacing-properties: (
27
+ 'padding': 'padding',
28
+ 'margin': 'margin',
29
+ ) !default;
30
+
31
+ $inuit-spacing-sizes: (
32
+ null: $inuit-global-spacing-unit,
33
+ '-tiny': $inuit-global-spacing-unit-tiny,
34
+ '-small': $inuit-global-spacing-unit-small,
35
+ '-large': $inuit-global-spacing-unit-large,
36
+ '-huge': $inuit-global-spacing-unit-huge,
37
+ '-none': 0
38
+ ) !default;
39
+
40
+
41
+ @each $property, $property-namespace in $inuit-spacing-properties {
42
+
43
+ @each $direction, $direction-namespace in $inuit-spacing-directions {
44
+
45
+ @each $size, $value in $inuit-spacing-sizes {
46
+
47
+ .u-#{$property-namespace}#{$direction-namespace}#{$size} {
48
+ #{$property}#{$direction}: $value !important;
49
+ }
50
+
51
+ }
52
+
53
+ }
54
+
55
+ }
56
+
57
+ /* stylelint-enable string-quotes */
@@ -0,0 +1,167 @@
1
+ /* ==========================================================================
2
+ #WIDTHS
3
+ ========================================================================== */
4
+
5
+ /**
6
+ * inuitcss generates a series of utility classes that give a fluid width to
7
+ * whichever element they’re applied, e.g.:
8
+ *
9
+ * <img src="" alt="" class="u-1/2" />
10
+ *
11
+ * These classes are most commonly used in conjunction with our layout system,
12
+ * e.g.:
13
+ *
14
+ * <div class="o-layout__item u-1/2">
15
+ *
16
+ * By default, inuitcss will also generate responsive variants of each of these
17
+ * classes by using your Sass MQ configuration, e.g.:
18
+ *
19
+ * <div class="o-layout__item u-1/1 u-1/2@tablet u-1/3@desktop">
20
+ *
21
+ * Optionally, inuitcss can generate offset classes which can push and pull
22
+ * elements left and right by a specified amount, e.g.:
23
+ *
24
+ * <div class="o-layout__item u-2/3 u-pull-1/3">
25
+ *
26
+ * This is useful for making very granular changes to the rendered order of
27
+ * items in a layout.
28
+ *
29
+ * N.B. This option is turned off by default.
30
+ */
31
+
32
+
33
+
34
+
35
+
36
+ // Which fractions would you like in your grid system(s)? By default, inuitcss
37
+ // provides you fractions of one whole, halves, thirds, quarters and fifths,
38
+ // e.g.:
39
+ //
40
+ // .u-1/2
41
+ // .u-2/5
42
+ // .u-3/4
43
+ // .u-2/3
44
+
45
+ $inuit-fractions: 1 2 3 4 5 !default;
46
+
47
+
48
+
49
+
50
+
51
+ // Optionally, inuitcss can generate classes to offset items by a certain width.
52
+ // Would you like to generate these types of class as well? E.g.:
53
+ //
54
+ // .u-push-1/3
55
+ // .u-pull-2/4
56
+ // .u-pull-1/5
57
+ // .u-push-2/3
58
+
59
+ $inuit-offsets: false !default;
60
+
61
+
62
+
63
+
64
+
65
+ // By default, inuitcss uses fractions-like classes like `<div class="u-1/4">`.
66
+ // You can change the `/` to whatever you fancy with this variable.
67
+ $inuit-widths-delimiter: \/ !default;
68
+
69
+
70
+
71
+
72
+
73
+ // When using Sass-MQ, this defines the separator for the breakpoints suffix
74
+ // in the class name. By default, we are generating the responsive suffixes
75
+ // for the classes with a `@` symbol so you get classes like:
76
+ // <div class="u-3/12@mobile">
77
+ $inuit-widths-breakpoint-separator: \@ !default;
78
+
79
+
80
+
81
+
82
+
83
+ // A mixin to spit out our width classes. Pass in the columns we want the widths
84
+ // to have, and an optional suffix for responsive widths. E.g. to create thirds
85
+ // and quarters for a small breakpoint:
86
+ //
87
+ // @include widths(3 4, -sm);
88
+
89
+ @mixin inuit-widths($columns, $breakpoint: null) {
90
+
91
+ // Loop through the number of columns for each denominator of our fractions.
92
+ @each $denominator in $columns {
93
+
94
+ // Begin creating a numerator for our fraction up until we hit the
95
+ // denominator.
96
+ @for $numerator from 1 through $denominator {
97
+
98
+ // Build a class in the format `.u-3/4[@<breakpoint>]`.
99
+ .u-#{$numerator}#{$inuit-widths-delimiter}#{$denominator}#{$breakpoint} {
100
+ width: ($numerator / $denominator) * 100% !important;
101
+ }
102
+
103
+ @if ($inuit-offsets == true) {
104
+
105
+ /**
106
+ * 1. Reset any leftover or conflicting `left`/`right` values.
107
+ */
108
+
109
+ // Build a class in the format `.u-push-1/2[@<breakpoint>]`.
110
+ .u-push-#{$numerator}#{$inuit-widths-delimiter}#{$denominator}#{$breakpoint} {
111
+ position: relative !important;
112
+ right: auto !important; /* [1] */
113
+ left: ($numerator / $denominator) * 100% !important;
114
+ }
115
+
116
+ // Build a class in the format `.u-pull-5/6[@<breakpoint>]`.
117
+ .u-pull-#{$numerator}#{$inuit-widths-delimiter}#{$denominator}#{$breakpoint} {
118
+ position: relative !important;
119
+ right: ($numerator / $denominator) * 100% !important;
120
+ left: auto !important; /* [1] */
121
+ }
122
+
123
+ }
124
+
125
+ }
126
+
127
+ }
128
+
129
+ }
130
+
131
+
132
+
133
+
134
+ /**
135
+ * A series of width helper classes that you can use to size things like grid
136
+ * systems. Classes take a fraction-like format (e.g. `.u-2/3`). Use these in
137
+ * your markup:
138
+ *
139
+ * <div class="u-7/12">
140
+ *
141
+ * The following will generate widths helper classes based on the fractions
142
+ * defined in the `$inuit-fractions` list.
143
+ */
144
+
145
+ @include inuit-widths($inuit-fractions);
146
+
147
+
148
+
149
+
150
+ /**
151
+ * If we’re using Sass-MQ, automatically generate grid system(s) for each of our
152
+ * defined breakpoints, and give them a Responsive Suffix, e.g.:
153
+ *
154
+ * <div class="u-3/12@mobile">
155
+ */
156
+
157
+ @if (variable-exists(mq-breakpoints)) {
158
+
159
+ @each $inuit-bp-name, $inuit-bp-value in $mq-breakpoints {
160
+
161
+ @include mq($from: $inuit-bp-name) {
162
+ @include inuit-widths($inuit-fractions, #{$inuit-widths-breakpoint-separator}#{$inuit-bp-name});
163
+ }
164
+
165
+ }
166
+
167
+ }