tungsten 0.1.0 → 0.1.1

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/tungsten/_form_helpers.js +21 -0
  3. data/app/assets/javascripts/tungsten/code.js +20 -0
  4. data/app/assets/javascripts/tungsten/tungsten.js +4 -20
  5. data/app/assets/stylesheets/tungsten/_code-color.scss +0 -0
  6. data/app/assets/stylesheets/tungsten/_colors.yml +68 -4
  7. data/app/assets/stylesheets/tungsten/_index.scss +5 -0
  8. data/app/assets/stylesheets/tungsten/code/_codemirror.scss +56 -0
  9. data/app/assets/stylesheets/tungsten/code/_color.scss +58 -0
  10. data/app/assets/stylesheets/tungsten/code/_highlighted.scss +64 -0
  11. data/app/assets/stylesheets/tungsten/code/_index.scss +3 -0
  12. data/app/assets/stylesheets/tungsten/core/_buttons.scss +144 -0
  13. data/app/assets/stylesheets/tungsten/core/_cards.scss +90 -0
  14. data/app/assets/stylesheets/tungsten/core/_colors.scss +20 -0
  15. data/app/assets/stylesheets/tungsten/core/_globals.scss +172 -0
  16. data/app/assets/stylesheets/tungsten/core/_grid.scss +164 -0
  17. data/app/assets/stylesheets/tungsten/core/_index.scss +7 -13
  18. data/app/assets/stylesheets/tungsten/core/_layout.scss +47 -0
  19. data/app/assets/stylesheets/tungsten/core/_text.scss +219 -0
  20. data/app/assets/stylesheets/tungsten/form/_base.scss +235 -0
  21. data/app/assets/stylesheets/tungsten/form/_check-radio.scss +154 -0
  22. data/app/assets/stylesheets/tungsten/form/_check-switch.scss +104 -0
  23. data/app/assets/stylesheets/tungsten/form/_index.scss +4 -0
  24. data/app/assets/stylesheets/tungsten/form/_label-placeholder.scss +98 -0
  25. data/app/assets/stylesheets/tungsten/tungsten.scss +1 -3
  26. data/app/helpers/tungsten/card_helper.rb +76 -0
  27. data/app/helpers/tungsten/deployments_helper.rb +59 -0
  28. data/app/helpers/tungsten/form_helper.rb +509 -0
  29. data/app/helpers/tungsten/layout_helper.rb +7 -0
  30. data/app/helpers/tungsten/toggle_nav_helper.rb +84 -0
  31. data/app/views/layouts/tungsten/default.html.slim +47 -0
  32. data/app/views/shared/tungsten/_defs.html.slim +6 -0
  33. data/app/views/shared/tungsten/_footer.html.slim +2 -0
  34. data/app/views/shared/tungsten/_header.html.slim +2 -0
  35. data/config/data/deployments.yml +110 -0
  36. data/lib/tungsten.rb +26 -2
  37. data/lib/tungsten/helper.rb +4 -0
  38. data/lib/tungsten/version.rb +1 -1
  39. data/public/{tungsten-0.1.0.js → code-0.1.1.js} +43 -69
  40. data/public/code-0.1.1.js.gz +0 -0
  41. data/public/code-0.1.1.map.json +1 -0
  42. data/public/tungsten-0.1.1.css +1523 -0
  43. data/public/tungsten-0.1.1.css.gz +0 -0
  44. data/public/tungsten-0.1.1.js +79 -0
  45. data/public/tungsten-0.1.1.js.gz +0 -0
  46. data/public/tungsten-0.1.1.map.json +1 -0
  47. metadata +120 -16
  48. data/app/helpers/tungsten/application_helper.rb +0 -4
  49. data/app/views/layouts/tungsten/default.html.erb +0 -17
  50. data/public/tungsten-0.1.0.css +0 -17
  51. data/public/tungsten-0.1.0.css.gz +0 -0
  52. data/public/tungsten-0.1.0.js.gz +0 -0
  53. data/public/tungsten-0.1.0.map.json +0 -1
@@ -1,13 +1,7 @@
1
- // Solid color classes
2
- @each $name, $color in $colors {
3
- // Assign a `.[color]-text` class with a color of [color]
4
- .#{$name}-text {
5
- color: $color;
6
- }
7
-
8
- .#{$name}-bg {
9
- // &:before {
10
- background-color: $color;
11
- // }
12
- }
13
- }
1
+ @import 'colors';
2
+ @import 'globals';
3
+ @import 'grid';
4
+ @import 'layout';
5
+ @import 'text';
6
+ @import 'buttons';
7
+ @import 'cards';
@@ -0,0 +1,47 @@
1
+ /* ===================================== *
2
+ * Universal
3
+ * ------------------------------------- */
4
+
5
+ *,
6
+ *:after,
7
+ *:before {
8
+ margin: 0;
9
+ padding: 0;
10
+ outline: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ /* ===================================== *
15
+ * Document
16
+ * ------------------------------------- */
17
+
18
+ body {
19
+ display: flex;
20
+ min-height: 100vh;
21
+ flex-direction: column;
22
+ font-weight: 400;
23
+ font-size: $base-size;
24
+ }
25
+
26
+ body,
27
+ input,
28
+ textarea {
29
+ color: $gray-11;
30
+ }
31
+
32
+ /* ===================================== *
33
+ * Visibility
34
+ * ------------------------------------- */
35
+
36
+ .hidden {
37
+ display: none;
38
+ visibility: hidden;
39
+ }
40
+
41
+ // Temporary content stuffs
42
+ .content {
43
+ max-width: 1200px;
44
+ padding: $content-padding;
45
+ margin-left: auto;
46
+ margin-right: auto;
47
+ }
@@ -0,0 +1,219 @@
1
+ /* ========================================================================== *
2
+ * Text module
3
+ * -------------------------------------------------------------------------- */
4
+
5
+ /* ===================================== *
6
+ * Common
7
+ * ------------------------------------- */
8
+
9
+ body,
10
+ input,
11
+ select,
12
+ button,
13
+ textarea {
14
+ color: $gray-10;
15
+ font-family: $base-font;
16
+ line-height: $base-line-height;
17
+ @include font-smoothing;
18
+ }
19
+
20
+ /* ===================================== *
21
+ * Heading
22
+ * ------------------------------------- */
23
+
24
+ h1,
25
+ h2,
26
+ h3,
27
+ h4,
28
+ h5,
29
+ h6 {
30
+ font-weight: 600;
31
+ }
32
+
33
+ // 1.125 modular scale - http://www.modularscale.com/?16&px&1.125&web&text
34
+ h1 {
35
+ font-size: 29px;
36
+ }
37
+
38
+ h2 {
39
+ font-size: 26px;
40
+ }
41
+
42
+ h3 {
43
+ font-size: 22px;
44
+ }
45
+
46
+ h4 {
47
+ font-size: 20px;
48
+ }
49
+
50
+ h5 {
51
+ font-size: 18px;
52
+ }
53
+
54
+ h6 {
55
+ font-size: 16px;
56
+ }
57
+
58
+ /* ===================================== *
59
+ * Blockquote
60
+ * ------------------------------------- */
61
+
62
+ /* ===================================== *
63
+ * Inline
64
+ * ------------------------------------- */
65
+
66
+ // Bold text
67
+ b,
68
+ strong {
69
+ font-weight: 700;
70
+ }
71
+
72
+ // Subscripts & superscripts
73
+ sub,
74
+ sup {
75
+ // Specified in % so that the sup/sup is the right size relative to the surrounding text
76
+ font-size: 75%;
77
+
78
+ // Zero out the line-height so that it doesn't interfere with the positioning that follows
79
+ line-height: 0;
80
+
81
+ // Where the magic happens: makes all browsers position the sup/sup properly, relative to the surrounding text
82
+ position: relative;
83
+
84
+ // Note that if you're using Eric Meyer's reset.css, this is already set and you can remove this rule
85
+ vertical-align: baseline;
86
+ }
87
+
88
+ // Move the superscripted text up
89
+ sup {
90
+ top: -0.5em;
91
+ }
92
+
93
+ // Move the subscripted text down, but only half as far down as the superscript moved up
94
+ sub {
95
+ bottom: -0.25em;
96
+ }
97
+
98
+ // Definitions & Abbreviations
99
+ dfn[title],
100
+ abbr[title] {
101
+ position: relative;
102
+ cursor: help;
103
+ font-style: normal;
104
+ text-decoration: none;
105
+ border-bottom: 1px dashed silver;
106
+
107
+ &:after,
108
+ &:before {
109
+ position: absolute;
110
+ opacity: 0;
111
+ z-index: -1;
112
+ }
113
+
114
+ &:after {
115
+ content: attr(title);
116
+ top: calc(100% + 6px);
117
+ left: 50%;
118
+ transform: translateX(-50%);
119
+ color: white;
120
+ font-size: 14px;
121
+ line-height: 1;
122
+ text-align: center;
123
+ white-space: nowrap;
124
+ padding: 10px;
125
+ border-radius: $radius;
126
+ background: black;
127
+ }
128
+
129
+ &:before {
130
+ content: '';
131
+ left: calc(50% - 5px);
132
+ top: 100%;
133
+ width: 0;
134
+ height: 0;
135
+ border-style: solid;
136
+ border-width: 0 5px 6px 5px;
137
+ border-color: transparent transparent black transparent;
138
+ }
139
+
140
+ &:hover:after,
141
+ &:hover:before {
142
+ opacity: 1;
143
+ z-index: 2;
144
+ }
145
+ }
146
+
147
+ // Links & buttons
148
+ a,
149
+ button {
150
+ color: inherit;
151
+ cursor: pointer;
152
+ }
153
+
154
+ a {
155
+ @include inline-link;
156
+ }
157
+
158
+ /* ===================================== *
159
+ * Horizontal rule
160
+ * ------------------------------------- */
161
+
162
+ hr {
163
+ border: solid silver;
164
+ border-width: 1px 0 0 0;
165
+ }
166
+
167
+ /* ===================================== *
168
+ * Preformatted text
169
+ * ------------------------------------- */
170
+
171
+ pre,
172
+ code,
173
+ kbd,
174
+ samp {
175
+ font-family: $mono-font;
176
+ font-weight: 400;
177
+ direction: ltr;
178
+ text-align: left;
179
+ tab-size: 2;
180
+ hyphens: none;
181
+ tab-size: 2;
182
+ hyphens: none;
183
+ }
184
+
185
+ pre {
186
+ overflow: auto;
187
+ padding: 2px 6px;
188
+ border-radius: $radius;
189
+ background: white;
190
+ word-wrap: break-word;
191
+ white-space: pre-wrap;
192
+ }
193
+
194
+ :not(pre) > code,
195
+ :not(pre) > kbd,
196
+ :not(pre) > samp {
197
+ line-height: 0;
198
+ word-wrap: break-word;
199
+ white-space: pre-wrap;
200
+ border-radius: $radius;
201
+ padding: 1px 4px;
202
+ box-shadow: 0 0 0 1px silver inset;
203
+ }
204
+
205
+ /* ===================================== *
206
+ * Text alignment
207
+ * ------------------------------------- */
208
+
209
+ .text-left {
210
+ text-align: left;
211
+ }
212
+
213
+ .text-center {
214
+ text-align: center;
215
+ }
216
+
217
+ .text-right {
218
+ text-align: right;
219
+ }
@@ -0,0 +1,235 @@
1
+ $text-inputs: 'textarea, input[type=url], input[type=tel], input[type=text], input[type=email], input[type=number], input[type=password], input[type=search]';
2
+
3
+
4
+ @mixin input-active {
5
+ &:focus,
6
+ &:hover:not([disabled]),
7
+ &:active {
8
+ @content;
9
+ }
10
+ }
11
+
12
+ $input-weight-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
13
+ $empty-shadow: 0 0 0 transparent;
14
+
15
+ label { *, *:before, *:after {
16
+ transition-duration: $duration;
17
+ transition-timing-function: $timing;
18
+ }}
19
+
20
+ @function input-shadow($color: $gray-06, $size: 1px) {
21
+ @return 0 0 0 $size $color inset, $empty-shadow;
22
+ }
23
+
24
+ @function input-focus-shadow($color: $gray-08) {
25
+ @return 0 0 0 1px $color inset, $input-weight-shadow
26
+ }
27
+
28
+ $focus-shadow: input-focus-shadow();
29
+ $input-shadow: input-shadow();
30
+
31
+ form {
32
+ width: 100%;
33
+
34
+ &.max {
35
+ max-width: 100%;
36
+ }
37
+
38
+ }
39
+
40
+ .switch-label, .tick-label {
41
+ pointer-events: none;
42
+ * { pointer-events: all; }
43
+ }
44
+
45
+ label {
46
+ // Bare text-based inputs
47
+ + input,
48
+ + select,
49
+ + textarea {
50
+ margin-top: -5px;
51
+ }
52
+
53
+ [type=checkbox], [type=radio] {
54
+ position: absolute;
55
+ border: none;
56
+ cursor: pointer;
57
+ opacity: 0;
58
+ z-index: -1;
59
+ }
60
+ }
61
+
62
+ fieldset {
63
+ border: 0;
64
+ padding: 0;
65
+ margin-left: 0;
66
+ margin-right: 0;
67
+ }
68
+
69
+ // Fieldset legends
70
+ legend {
71
+ font-size: 24px;
72
+ font-weight: 300;
73
+ padding-top: 11px;
74
+ width: 100%;
75
+ margin-bottom: 19px;
76
+ + * {
77
+ clear: both;
78
+ }
79
+ }
80
+
81
+ fieldset h2, legend.header {
82
+ text-transform: none;
83
+ letter-spacing: normal;
84
+ justify-content: space-between;
85
+ box-shadow: none;
86
+ font-weight: 300;
87
+ width: 100%;
88
+ float: left;
89
+ font-size: 24px;
90
+ padding: 20px 0 0; // 30px
91
+ margin: 0 0 30px; // 30px
92
+ text-align: center;
93
+ + * { clear: both; }
94
+ }
95
+
96
+
97
+ @mixin input-base {
98
+ width: 100%;
99
+ font-size: 16px;
100
+ border: none;
101
+ line-height: 30px;
102
+ padding: 9px 12px;
103
+ border-radius: $radius;
104
+ transition-property: box-shadow, color;
105
+ appearance: none;
106
+ box-shadow: $input-shadow;
107
+
108
+ // Keep Chrome’s autofilled fields white
109
+ &:-webkit-autofill {
110
+ -webkit-box-shadow: 0 0 0 1000px $white inset;
111
+ }
112
+
113
+ &:disabled:not([type="submit"]) {
114
+ color: $gray-05;
115
+ cursor: default;
116
+ }
117
+ }
118
+
119
+ input, select, textarea {
120
+ outline: 0;
121
+ outline-style: none;
122
+ border: none;
123
+
124
+ &::-moz-focus-inner {
125
+ border: none;
126
+ padding: 0;
127
+ }
128
+
129
+ }
130
+
131
+ #{$text-inputs}, select, textarea {
132
+ @include input-base;
133
+
134
+ @include input-active {
135
+ box-shadow: $focus-shadow;
136
+ }
137
+ }
138
+
139
+ textarea {
140
+ line-height: 20px;
141
+ }
142
+
143
+ // Override default search styling
144
+ input[type=search] {
145
+ &,
146
+ &::-webkit-search-decoration,
147
+ &::-webkit-search-cancel-button {
148
+ -webkit-appearance: none;
149
+ }
150
+ }
151
+
152
+ select {
153
+ min-height: 50px;
154
+ cursor: pointer;
155
+ background: $white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 14'%3E%3Cpolygon fill='%237A7B7C' points='3.5,0 0,6 7,6'/%3E%3Cpolygon fill='%237A7B7C' points='3.5,14 0,8 7,8'/%3E%3C/svg%3E") calc(100% - 14px) 50% / 7px 14px no-repeat;
156
+ }
157
+
158
+ // Confine resizing of textareas
159
+ textarea {
160
+ display: block;
161
+ resize: vertical;
162
+ margin-top: 10px;
163
+ min-height: 100px;
164
+ }
165
+
166
+ // Bare inputs
167
+ :not(label) > {
168
+ input,
169
+ select,
170
+ textarea {
171
+ margin: 15px 0;
172
+ }
173
+ }
174
+
175
+ ::placeholder {
176
+ opacity: 1;
177
+ color: $gray-06;
178
+ }
179
+
180
+ input[type=number]::-webkit-outer-spin-button,
181
+ input[type=number]::-webkit-inner-spin-button {
182
+ -webkit-appearance: none;
183
+ margin: 0;
184
+ }
185
+
186
+ .form-row {
187
+ display: flex;
188
+ justify-content: space-between;
189
+ align-items: flex-end;
190
+ flex-wrap: wrap;
191
+ margin: 0 -5px;
192
+
193
+ > * {
194
+ padding: 0 5px;
195
+ }
196
+ }
197
+
198
+ .wide-cell {
199
+ flex: 1 0 auto;
200
+ @include until(400px) {
201
+ width: 100%;
202
+ }
203
+ }
204
+
205
+ .button-cell {
206
+ display: flex;
207
+ flex-direction: row-reverse;
208
+
209
+ @include until(550px) {
210
+ width: 100%;
211
+ }
212
+
213
+ @include until(400px) {
214
+ a.button, button {
215
+ width: 100%;
216
+ }
217
+ }
218
+ }
219
+
220
+ label {
221
+ display: flex;
222
+ font-size: 15px;
223
+ flex-direction: column;
224
+ position: relative;
225
+ flex: 1 0 auto;
226
+ margin: 18px 0;
227
+
228
+ &.label-text {
229
+ transition-property: box-shadow, color;
230
+ }
231
+ select, input, textarea {
232
+ margin: 0px;
233
+ }
234
+ }
235
+