suitcss-rails 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +4 -0
  6. data/README.md +37 -0
  7. data/Rakefile +6 -0
  8. data/app/assets/stylesheets/normalize.css +424 -0
  9. data/app/assets/stylesheets/suitcss.css +5 -0
  10. data/app/assets/stylesheets/suitcss/base.css +1 -0
  11. data/app/assets/stylesheets/suitcss/base/index.css +83 -0
  12. data/app/assets/stylesheets/suitcss/components.css +4 -0
  13. data/app/assets/stylesheets/suitcss/components/arrange.css +155 -0
  14. data/app/assets/stylesheets/suitcss/components/button.css +77 -0
  15. data/app/assets/stylesheets/suitcss/components/flex-embed.css +74 -0
  16. data/app/assets/stylesheets/suitcss/components/grid.css +121 -0
  17. data/app/assets/stylesheets/suitcss/utils.css +9 -0
  18. data/app/assets/stylesheets/suitcss/utils/after.css +4 -0
  19. data/app/assets/stylesheets/suitcss/utils/after/index.css +117 -0
  20. data/app/assets/stylesheets/suitcss/utils/after/lg.css +127 -0
  21. data/app/assets/stylesheets/suitcss/utils/after/md.css +127 -0
  22. data/app/assets/stylesheets/suitcss/utils/after/sm.css +127 -0
  23. data/app/assets/stylesheets/suitcss/utils/align.css +21 -0
  24. data/app/assets/stylesheets/suitcss/utils/before.css +4 -0
  25. data/app/assets/stylesheets/suitcss/utils/before/index.css +117 -0
  26. data/app/assets/stylesheets/suitcss/utils/before/lg.css +127 -0
  27. data/app/assets/stylesheets/suitcss/utils/before/md.css +127 -0
  28. data/app/assets/stylesheets/suitcss/utils/before/sm.css +127 -0
  29. data/app/assets/stylesheets/suitcss/utils/display.css +53 -0
  30. data/app/assets/stylesheets/suitcss/utils/flex.css +4 -0
  31. data/app/assets/stylesheets/suitcss/utils/flex/index.css +253 -0
  32. data/app/assets/stylesheets/suitcss/utils/flex/lg.css +259 -0
  33. data/app/assets/stylesheets/suitcss/utils/flex/md.css +259 -0
  34. data/app/assets/stylesheets/suitcss/utils/flex/sm.css +259 -0
  35. data/app/assets/stylesheets/suitcss/utils/layout.css +66 -0
  36. data/app/assets/stylesheets/suitcss/utils/link.css +55 -0
  37. data/app/assets/stylesheets/suitcss/utils/offset.css +2 -0
  38. data/app/assets/stylesheets/suitcss/utils/position.css +48 -0
  39. data/app/assets/stylesheets/suitcss/utils/size.css +4 -0
  40. data/app/assets/stylesheets/suitcss/utils/size/index.css +172 -0
  41. data/app/assets/stylesheets/suitcss/utils/size/lg.css +176 -0
  42. data/app/assets/stylesheets/suitcss/utils/size/md.css +176 -0
  43. data/app/assets/stylesheets/suitcss/utils/size/sm.css +176 -0
  44. data/app/assets/stylesheets/suitcss/utils/text.css +76 -0
  45. data/bin/console +14 -0
  46. data/bin/setup +8 -0
  47. data/lib/suitcss/rails.rb +6 -0
  48. data/lib/suitcss/rails/version.rb +5 -0
  49. data/suitcss-rails.gemspec +24 -0
  50. metadata +133 -0
@@ -0,0 +1,5 @@
1
+ @import "normalize";
2
+
3
+ @import "suitcss/base";
4
+ @import "suitcss/utils";
5
+ @import "suitcss/components";
@@ -0,0 +1 @@
1
+ @import "base/index";
@@ -0,0 +1,83 @@
1
+ /**
2
+ * A thin layer on top of normalize.css that provides a starting point more
3
+ * suitable for web applications.
4
+ */
5
+
6
+ /**
7
+ * Prevent margin and border from affecting element width.
8
+ * https://goo.gl/pYtbK7
9
+ * `input[type="search"]` overrides normalize.css more specific rule.
10
+ */
11
+
12
+ html {
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ *,
17
+ *::before,
18
+ *::after,
19
+ input[type="search"] {
20
+ box-sizing: inherit;
21
+ }
22
+
23
+ /**
24
+ * Removes the default spacing and border for appropriate elements.
25
+ */
26
+
27
+ blockquote,
28
+ dl,
29
+ dd,
30
+ h1,
31
+ h2,
32
+ h3,
33
+ h4,
34
+ h5,
35
+ h6,
36
+ figure,
37
+ p,
38
+ pre {
39
+ margin: 0;
40
+ }
41
+
42
+ button {
43
+ background: transparent;
44
+ border: 0;
45
+ padding: 0;
46
+ }
47
+
48
+ /**
49
+ * Work around a Firefox/IE bug where the transparent `button` background
50
+ * results in a loss of the default `button` focus styles.
51
+ */
52
+
53
+ button:focus {
54
+ outline: 1px dotted;
55
+ outline: 5px auto -webkit-focus-ring-color;
56
+ }
57
+
58
+ fieldset {
59
+ border: 0;
60
+ margin: 0;
61
+ padding: 0;
62
+ }
63
+
64
+ iframe {
65
+ border: 0;
66
+ }
67
+
68
+ ol,
69
+ ul {
70
+ list-style: none;
71
+ margin: 0;
72
+ padding: 0;
73
+ }
74
+
75
+ /**
76
+ * Suppress the focus outline on elements that cannot be accessed via keyboard.
77
+ * This prevents an unwanted focus outline from appearing around elements that
78
+ * might still respond to pointer events.
79
+ */
80
+
81
+ [tabindex="-1"]:focus {
82
+ outline: none !important;
83
+ }
@@ -0,0 +1,4 @@
1
+ @import "components/arrange";
2
+ @import "components/button";
3
+ @import "components/flex-embed";
4
+ @import "components/grid";
@@ -0,0 +1,155 @@
1
+ /** @define Arrange; weak */
2
+
3
+ :root {
4
+ --Arrange-gutter-size: 10px;
5
+ }
6
+
7
+ /**
8
+ * This component lets you lay out a row of cells in various ways. You can
9
+ * specify whether a cell should be wide enough to fit its content, or take up
10
+ * the remaining space in the row. It's also possible to give all cells an
11
+ * equal width, and to control their vertical alignment.
12
+ */
13
+
14
+ /**
15
+ * 1. Protect against the component expanding beyond the confines of its
16
+ * container if properties affecting the box-model are applied to the
17
+ * component. Mainly necessary because of (5).
18
+ * 2. Rely on table layout.
19
+ * 3. Zero out the default spacing that might be on an element (e.g., `ul`).
20
+ * 4. Make sure the component fills at least the full width of its parent.
21
+ * 5. Reset the table-layout algorithm in case a component is nested.
22
+ */
23
+
24
+ .Arrange {
25
+ box-sizing: border-box; /* 1 */
26
+ display: table; /* 2 */
27
+ margin: 0; /* 3 */
28
+ min-width: 100%; /* 4 */
29
+ padding: 0; /* 3 */
30
+ table-layout: auto; /* 5 */
31
+ }
32
+
33
+ /**
34
+ * There are three possible types of child. `sizeFill` will expand to fill all
35
+ * of the remaining space not filled by `sizeFit` elements. `row` will begin a
36
+ * new row context, keeping columns the same size.
37
+ *
38
+ * 1. Zero out any default spacing that might be on an element (e.g., `li`);
39
+ * Margin has no effect when coupled with `display: table-cell`.
40
+ * 2. All cells are top-aligned by default
41
+ */
42
+
43
+ .Arrange-sizeFill,
44
+ .Arrange-sizeFit {
45
+ display: table-cell;
46
+ padding: 0; /* 1 */
47
+ vertical-align: top; /* 2 */
48
+ }
49
+
50
+ /**
51
+ * Make sure the main content block expands to fill the remaining space.
52
+ */
53
+
54
+ .Arrange-sizeFill {
55
+ width: 100%;
56
+ }
57
+
58
+ /**
59
+ * Where possible, protect against large images breaking the layout. Prevent them from
60
+ * exceeding the width of the main content block by making them fluid.
61
+ *
62
+ * Only work for all browsers with the `Arrange--equally` variant. For Firefox
63
+ * and IE to constrain image dimensions for other layouts, large images will
64
+ * need their width set to `100%`.
65
+ */
66
+
67
+ .Arrange-sizeFill img {
68
+ height: auto;
69
+ max-width: 100%;
70
+ }
71
+
72
+ /**
73
+ * Defend against a side-effect of this layout pattern: images in
74
+ * 'Arrange-sizeFit' cannot be fluid, otherwise they lose their ability to
75
+ * provide size to a cell.
76
+ */
77
+
78
+ .Arrange-sizeFit img {
79
+ max-width: none !important;
80
+ width: auto !important;
81
+ }
82
+
83
+ /**
84
+ * Start a new row context.
85
+ */
86
+
87
+ .Arrange-row {
88
+ display: table-row;
89
+ }
90
+
91
+ /* Vertical alignment modifiers
92
+ ========================================================================== */
93
+
94
+ .Arrange--middle > .Arrange-sizeFill,
95
+ .Arrange--middle > .Arrange-sizeFit {
96
+ vertical-align: middle;
97
+ }
98
+
99
+ .Arrange--bottom > .Arrange-sizeFill,
100
+ .Arrange--bottom > .Arrange-sizeFit {
101
+ vertical-align: bottom;
102
+ }
103
+
104
+ /* Equal-width modifier
105
+ ========================================================================== */
106
+
107
+ /**
108
+ * This layout algorithm will create equal-width table cells, irrespective of
109
+ * the width of their content.
110
+ *
111
+ * 1. The layout algorithm requires a set width to correctly calculate table
112
+ * cell width.
113
+ */
114
+
115
+ .Arrange--equal {
116
+ table-layout: fixed;
117
+ width: 100%; /* 1 */
118
+ }
119
+
120
+ /**
121
+ * Give the cells an equal width. This value ensures that Arrange is still 100%
122
+ * wide when gutters are used in conjunctions with equal-width cells.
123
+ *
124
+ * It's recommended that only 'Arrange-sizeFill' be used for equal width cells.
125
+ * Their inner images will automatically be responsive.
126
+ */
127
+
128
+ .Arrange--equal > .Arrange-sizeFill,
129
+ .Arrange--equal > .Arrange-sizeFit,
130
+ .Arrange--equal > .Arrange-row > .Arrange-sizeFill,
131
+ .Arrange--equal > .Arrange-row > .Arrange-sizeFit {
132
+ width: 1%;
133
+ }
134
+
135
+ /* Gutter modifier
136
+ ========================================================================== */
137
+
138
+ /**
139
+ * Add a gutter between cells
140
+ *
141
+ * NOTE: this can trigger a horizontal scrollbar if the component is as wide as
142
+ * the viewport. Use padding on a container, or `overflow-x:hidden` to protect
143
+ * against it.
144
+ */
145
+
146
+ .Arrange--withGutter {
147
+ margin: 0 calc(-0.5 * var(--Arrange-gutter-size));
148
+ }
149
+
150
+ .Arrange--withGutter > .Arrange-sizeFit,
151
+ .Arrange--withGutter > .Arrange-sizeFill,
152
+ .Arrange--withGutter > .Arrange-row > .Arrange-sizeFit,
153
+ .Arrange--withGutter > .Arrange-row > .Arrange-sizeFill {
154
+ padding: 0 calc(0.5 * var(--Arrange-gutter-size));
155
+ }
@@ -0,0 +1,77 @@
1
+ /** @define Button */
2
+
3
+ :root {
4
+ --Button-border-color: currentcolor;
5
+ --Button-border-width: 1px;
6
+ --Button-color: inherit;
7
+ --Button-disabled-opacity: 0.6;
8
+ --Button-font: inherit;
9
+ --Button-padding: 0.4em 0.75em;
10
+ }
11
+
12
+ /**
13
+ * The button classes are best applied to links and buttons.
14
+ * These components can be used in forms, as calls to action, or as part of the
15
+ * general UI of the site/app.
16
+ */
17
+
18
+ /**
19
+ * 1. Normalize `box-sizing` across all elements that this component could be
20
+ * applied to.
21
+ * 2. Inherit text color from ancestor.
22
+ * 3. Inherit font styles from ancestor.
23
+ * 4. Prevent button text from being selectable.
24
+ */
25
+
26
+ .Button {
27
+ background: transparent;
28
+ border-color: var(--Button-border-color);
29
+ border-style: solid;
30
+ border-width: var(--Button-border-width);
31
+ box-sizing: border-box; /* 1 */
32
+ color: var(--Button-color); /* 2 */
33
+ cursor: pointer;
34
+ display: inline-block;
35
+ font: var(--Button-font); /* 3 */
36
+ margin: 0;
37
+ padding: var(--Button-padding);
38
+ position: relative;
39
+ text-align: center;
40
+ text-decoration: none;
41
+ user-select: none; /* 4 */
42
+ }
43
+
44
+ /**
45
+ * Remove excess padding and border in Firefox 4+
46
+ */
47
+
48
+ .Button::-moz-focus-inner {
49
+ border: 0;
50
+ padding: 0;
51
+ }
52
+
53
+ /**
54
+ * Work around a Firefox/IE bug where the transparent `button` background
55
+ * results in a loss of the default `button` focus styles.
56
+ */
57
+
58
+ .Button:focus {
59
+ outline: 1px dotted;
60
+ outline: 5px auto -webkit-focus-ring-color;
61
+ }
62
+
63
+ /**
64
+ * UI states
65
+ */
66
+
67
+ .Button:hover,
68
+ .Button:focus,
69
+ .Button:active {
70
+ text-decoration: none;
71
+ }
72
+
73
+ .Button:disabled,
74
+ .Button.is-disabled {
75
+ cursor: default;
76
+ opacity: var(--Button-disabled-opacity);
77
+ }
@@ -0,0 +1,74 @@
1
+
2
+ /** @define FlexEmbed */
3
+
4
+ /**
5
+ * Flexible media embeds
6
+ *
7
+ * For use with media embeds – such as videos, slideshows, or even images –
8
+ * that need to retain a specific aspect ratio but adapt to the width of their
9
+ * containing element.
10
+ *
11
+ * Based on: http://alistapart.com/article/creating-intrinsic-ratios-for-video
12
+ */
13
+
14
+ .FlexEmbed {
15
+ display: block;
16
+ overflow: hidden;
17
+ position: relative;
18
+ }
19
+
20
+ /**
21
+ * The aspect-ratio hack is applied to an empty element because it allows
22
+ * the component to respect `max-height`. Default aspect ratio is 1:1.
23
+ */
24
+
25
+ .FlexEmbed-ratio {
26
+ display: block;
27
+ padding-bottom: 100%;
28
+ width: 100%;
29
+ }
30
+
31
+ /**
32
+ * Modifier: 3:1 aspect ratio
33
+ */
34
+
35
+ .FlexEmbed-ratio--3by1 {
36
+ padding-bottom: calc(100% / 3);
37
+ }
38
+
39
+ /**
40
+ * Modifier: 2:1 aspect ratio
41
+ */
42
+
43
+ .FlexEmbed-ratio--2by1 {
44
+ padding-bottom: 50%;
45
+ }
46
+
47
+ /**
48
+ * Modifier: 16:9 aspect ratio
49
+ */
50
+
51
+ .FlexEmbed-ratio--16by9 {
52
+ padding-bottom: 56.25%;
53
+ }
54
+
55
+ /**
56
+ * Modifier: 4:3 aspect ratio
57
+ */
58
+
59
+ .FlexEmbed-ratio--4by3 {
60
+ padding-bottom: 75%;
61
+ }
62
+
63
+ /**
64
+ * Fit the content to the aspect ratio
65
+ */
66
+
67
+ .FlexEmbed-content {
68
+ bottom: 0;
69
+ height: 100%;
70
+ left: 0;
71
+ position: absolute;
72
+ top: 0;
73
+ width: 100%;
74
+ }
@@ -0,0 +1,121 @@
1
+ /** @define Grid */
2
+
3
+ :root {
4
+ --Grid-gutter-size: 20px;
5
+ }
6
+
7
+ /**
8
+ * Core grid component
9
+ *
10
+ * DO NOT apply dimension or offset utilities to the `Grid` element. All cell
11
+ * widths and offsets should be applied to child grid cells.
12
+ */
13
+
14
+ /* Grid container
15
+ ========================================================================== */
16
+
17
+ /**
18
+ * All content must be contained within child `Grid-cell` elements.
19
+ *
20
+ * 1. Account for browser defaults of elements that might be the root node of
21
+ * the component.
22
+ */
23
+
24
+ .Grid {
25
+ box-sizing: border-box;
26
+ display: flex; /* 1 */
27
+ flex-flow: row wrap;
28
+ margin: 0; /* 1 */
29
+ padding: 0; /* 1 */
30
+ }
31
+
32
+ /**
33
+ * Modifier: center align all grid cells
34
+ */
35
+
36
+ .Grid--alignCenter {
37
+ justify-content: center;
38
+ }
39
+
40
+ /**
41
+ * Modifier: right align all grid cells
42
+ */
43
+
44
+ .Grid--alignRight {
45
+ justify-content: flex-end;
46
+ }
47
+
48
+ /**
49
+ * Modifier: middle-align grid cells
50
+ */
51
+
52
+ .Grid--alignMiddle {
53
+ align-items: center;
54
+ }
55
+
56
+ /**
57
+ * Modifier: bottom-align grid cells
58
+ */
59
+
60
+ .Grid--alignBottom {
61
+ align-items: flex-end;
62
+ }
63
+
64
+ /**
65
+ * Modifier: allow cells to equal distribute width
66
+ *
67
+ * 1. Provide all values to avoid IE10 bug with shorthand flex
68
+ * http://git.io/vllC7
69
+ *
70
+ * Use `0%` to avoid bug in IE10/11 with unitless flex basis
71
+ * http://git.io/vllWx
72
+ */
73
+
74
+ .Grid--fit > .Grid-cell {
75
+ flex: 1 1 0%; /* 1 */
76
+ }
77
+
78
+ /**
79
+ * Modifier: all cells match height of tallest cell in a row
80
+ */
81
+
82
+ .Grid--equalHeight > .Grid-cell {
83
+ display: flex;
84
+ }
85
+
86
+ /**
87
+ * Modifier: gutters
88
+ */
89
+
90
+ .Grid--withGutter {
91
+ margin: 0 calc(-0.5 * var(--Grid-gutter-size));
92
+ }
93
+
94
+ .Grid--withGutter > .Grid-cell {
95
+ padding: 0 calc(0.5 * var(--Grid-gutter-size));
96
+ }
97
+
98
+ /* Grid cell
99
+ ========================================================================== */
100
+
101
+ /**
102
+ * No explicit width by default. Rely on combining `Grid-cell` with a dimension
103
+ * utility or a component class that extends 'Grid'.
104
+ *
105
+ * 1. Set flex items to full width by default
106
+ */
107
+
108
+ .Grid-cell {
109
+ box-sizing: inherit;
110
+ flex: 0 0 100%; /* 1 */
111
+ }
112
+
113
+ /**
114
+ * Modifier: horizontally center one unit
115
+ * Set a specific unit to be horizontally centered. Doesn't affect
116
+ * any other units. Can still contain a child `Grid` object.
117
+ */
118
+
119
+ .Grid-cell--center {
120
+ margin: 0 auto;
121
+ }