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
@@ -0,0 +1,90 @@
1
+ /* ========================================================================== *
2
+ * Card module
3
+ * -------------------------------------------------------------------------- */
4
+
5
+ @mixin card {
6
+ background: $white;
7
+ border-radius: $radius;
8
+ box-shadow:
9
+ 0 0 0 1px rgba($gray-11, .05),
10
+ 0 1px 3px rgba($gray-11, .15);
11
+ }
12
+
13
+ .card {
14
+ display: flex;
15
+ flex-direction: column;
16
+ position: relative;
17
+ padding: $card-padding;
18
+ font-size: 14px;
19
+ @include collapse-top;
20
+
21
+ &-actions {
22
+ display: flex;
23
+ align-items: baseline;
24
+ margin-top: $card-padding;
25
+ flex-direction: row-reverse;
26
+
27
+ > *:last-child {
28
+ margin: 0;
29
+ }
30
+
31
+ &.centered {
32
+ justify-content: center;
33
+ }
34
+
35
+ a,
36
+ button {
37
+ margin-left: 10px;
38
+ }
39
+ }
40
+
41
+ #{$block-elements} {
42
+ margin-top: 15px;
43
+ }
44
+
45
+ &:not([class*='columns']) {
46
+ @include card;
47
+ }
48
+
49
+ &[class*='columns'] {
50
+ flex-direction: row;
51
+
52
+ &:before {
53
+ content: '';
54
+ @include card;
55
+ position: absolute;
56
+ z-index: -1;
57
+ left: 0;
58
+ top: 0;
59
+ right: 0;
60
+ bottom: 0;
61
+ }
62
+ }
63
+
64
+ &-heading {
65
+ font-size: 16px;
66
+ }
67
+
68
+ &-footer {
69
+ display: flex;
70
+ align-items: baseline;
71
+ @include collapse-top;
72
+ font-size: 12px;
73
+ padding: $card-padding;
74
+ background: $gray-01;
75
+ border-radius: 0 0 $radius $radius;
76
+ box-shadow: 0 1px rgba($gray-11, .1) inset;
77
+ background-clip: padding-box;
78
+ border-top: $card-padding solid transparent;
79
+ margin: auto $card-padding * -1 $card-padding * -1 $card-padding * -1;
80
+
81
+ .card-actions {
82
+ margin-top: 0;
83
+ margin-left: auto;
84
+ }
85
+ }
86
+ }
87
+
88
+ table.card {
89
+ display: table;
90
+ }
@@ -0,0 +1,20 @@
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
+ background-color: $color;
10
+ }
11
+ }
12
+
13
+ @each $name, $colors in $gradients {
14
+ $start: nth($colors, 1);
15
+ $end: nth($colors, 2);
16
+
17
+ .#{$name}-gradient-bg {
18
+ background: linear-gradient(135deg, #{$start}, #{$end}) left top/100% 100% no-repeat;
19
+ }
20
+ }
@@ -0,0 +1,172 @@
1
+ /* ========================================================================== *
2
+ * Globals module
3
+ * -------------------------------------------------------------------------- */
4
+
5
+ /* ===================================== *
6
+ * Fonts
7
+ * ------------------------------------- */
8
+
9
+ // Font size & spacing
10
+ $base-size: 14px;
11
+ $base-line-height: 1.5;
12
+
13
+ // Fonts stacks
14
+ $base-font: -apple-system, BlinkMacSystemFont, 'Avenir Next', Avenir, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
15
+ $mono-font: 'Roboto Mono', Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace;
16
+
17
+ // Smooth fonts are smooth
18
+ @mixin font-smoothing($value: on) {
19
+ @if $value == on {
20
+ -webkit-font-smoothing: antialiased;
21
+ -moz-osx-font-smoothing: grayscale;
22
+ } @else {
23
+ -webkit-font-smoothing: subpixel-antialiased;
24
+ -moz-osx-font-smoothing: auto;
25
+ }
26
+ }
27
+
28
+ // Inline links
29
+ @mixin inline-link($default: $blue-03, $hover: $blue-04) {
30
+ text-decoration: underline;
31
+ text-decoration-color: rgba($default, .5);
32
+ transition: color $duration;
33
+
34
+ // Default state
35
+ @include normal {
36
+ color: $default;
37
+ }
38
+
39
+ // Active state
40
+ @include active {
41
+ color: $hover;
42
+ }
43
+ }
44
+
45
+ /* ===================================== *
46
+ * Animations
47
+ * ------------------------------------- */
48
+
49
+ // Transition duration
50
+ $duration: .25s;
51
+ $timing: cubic-bezier(0.4, 0.0, 0.2, 1);
52
+
53
+ // Class to prevent transitions
54
+ .full-stop * {
55
+ &,
56
+ &:after,
57
+ &:before {
58
+ transition: none !important;
59
+ animation: none !important;
60
+ }
61
+ }
62
+
63
+ /* ===================================== *
64
+ * Layout
65
+ * ------------------------------------- */
66
+
67
+ // Block-level elements that get vertical margin
68
+ $block-elements: p, ul, ol, h1, h2, h3, h4, h5, h6, pre, table;
69
+
70
+ // Border radius
71
+ $radius: 2px;
72
+
73
+ // Card padding
74
+ $card-padding: 20px;
75
+
76
+ // Inner content padding
77
+ $content-padding: 40px;
78
+
79
+ // Main header height
80
+ $header-height: 84px;
81
+
82
+ // Collapse top margin
83
+ @mixin collapse-top {
84
+ > *:first-child,
85
+ > *:first-child > *:first-child,
86
+ > *:first-child > *:first-child > *:first-child {
87
+ margin-top: 0;
88
+ }
89
+ }
90
+
91
+ // Collapse bottom margin
92
+ @mixin collapse-bottom {
93
+ > *:last-child,
94
+ > *:last-child > *:last-child,
95
+ > *:last-child > *:last-child > *:last-child {
96
+ margin-bottom: 0;
97
+ }
98
+ }
99
+
100
+ // Modules with max-width and padding
101
+ @mixin padded-module($width: 1100px, $padding: null, $nested: true) {
102
+ padding-left: calc(50vw - #{$width / 2});
103
+ padding-right: calc(50vw - #{$width / 2});
104
+
105
+ @if $nested {
106
+ width: 100vw;
107
+ }
108
+
109
+ @if $padding {
110
+ @media (max-width: $width + $padding * 2) {
111
+ padding-left: $padding;
112
+ padding-right: $padding;
113
+ }
114
+ }
115
+ }
116
+
117
+ // Center an element to the viewport regardless of nesting
118
+ @mixin center-to-viewport {
119
+ margin-left: calc(-50vw + 50%);
120
+ transform: translateX(calc(50vw - 50%));
121
+ }
122
+
123
+ /* ===================================== *
124
+ * Context
125
+ * ------------------------------------- */
126
+
127
+ // Normal link state mixin
128
+ @mixin normal {
129
+ &,
130
+ &:visited {
131
+ @content;
132
+ }
133
+ }
134
+
135
+ // Active link state mixin
136
+ @mixin active {
137
+ &:hover,
138
+ &:focus,
139
+ &:active {
140
+ @content;
141
+ }
142
+ }
143
+
144
+ // Until width media query mixin
145
+ @mixin until($width) {
146
+ $width: $width - 1;
147
+ @media all and (max-width: $width) {
148
+ @content;
149
+ }
150
+ }
151
+
152
+ // At least width media query mixin
153
+ @mixin at-least($width) {
154
+ @media all and (min-width: $width) {
155
+ @content;
156
+ }
157
+ }
158
+
159
+ // Between widths media query mixin
160
+ @mixin between($small-width, $large-width) {
161
+ $large-width: $large-width - 1;
162
+ @media (max-width: $large-width) and (min-width: $small-width) {
163
+ @content;
164
+ }
165
+ }
166
+
167
+ // HDPI screens media query mixin
168
+ @mixin hdpi {
169
+ @media (min-device-pixel-ratio: 1.3), (min-resolution: 120dpi), (min-resolution: 1.3dppx) {
170
+ @content;
171
+ }
172
+ }
@@ -0,0 +1,164 @@
1
+ /* ========================================================================== *
2
+ * Grid module
3
+ * -------------------------------------------------------------------------- */
4
+
5
+ /* ===================================== *
6
+ * Utilities
7
+ * ------------------------------------- */
8
+
9
+ $small-gutter : 7.5px;
10
+ $medium-gutter: 15px;
11
+ $large-gutter : 30px;
12
+ $columns : 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve';
13
+
14
+ // Horizontal gutter mixin
15
+ @mixin horizontal-gutter($amount) {
16
+ margin-left: -$amount / 2;
17
+ margin-right: -$amount / 2;
18
+
19
+ > * {
20
+ margin-left: $amount / 2;
21
+ margin-right: $amount / 2;
22
+ }
23
+ }
24
+
25
+ // Vertical gutter mixin
26
+ @mixin vertical-gutter($amount) {
27
+ margin-bottom: -$amount;
28
+
29
+ > * {
30
+ margin-bottom: $amount;
31
+ }
32
+ }
33
+
34
+ /* ===================================== *
35
+ * Common
36
+ * ------------------------------------- */
37
+
38
+ // Columns container
39
+ [class*='columns'] {
40
+ display: flex;
41
+ flex-flow: row wrap;
42
+ }
43
+
44
+ // Top-align columns in certain contexts
45
+ form [class*='columns'] {
46
+ align-items: flex-start;
47
+ }
48
+
49
+ // Normal gutter
50
+ .gutter {
51
+ @include horizontal-gutter($medium-gutter);
52
+
53
+ &.match {
54
+ @include vertical-gutter($medium-gutter);
55
+ }
56
+ }
57
+
58
+ // Small gutter
59
+ .small-gutter {
60
+ @include horizontal-gutter($small-gutter);
61
+
62
+ &.match {
63
+ @include vertical-gutter($small-gutter);
64
+ }
65
+ }
66
+
67
+ // Large gutter
68
+ .large-gutter {
69
+ @include horizontal-gutter($large-gutter);
70
+
71
+ &.match {
72
+ @include vertical-gutter($large-gutter);
73
+ }
74
+ }
75
+
76
+ // Flexible columns
77
+ .span {
78
+ flex: 1;
79
+ }
80
+
81
+ // Loop through columns
82
+ @for $a from 1 through length($columns) {
83
+
84
+ // Define column expanse
85
+ $span: (length($columns) / $a);
86
+
87
+ // No gutter placeholders
88
+ %span-#{nth($columns, $a)} {
89
+ flex: 0 1 100% / $span;
90
+ }
91
+
92
+ // Regular gutter placeholders
93
+ %span-#{nth($columns, $a)}-gutter {
94
+ flex: 0 1 calc(#{100% / $span} - #{$medium-gutter});
95
+ }
96
+
97
+ // Small gutter placeholders
98
+ %span-#{nth($columns, $a)}-small-gutter {
99
+ flex: 0 1 calc(#{100% / $span} - #{$small-gutter});
100
+ }
101
+
102
+ // Large gutter placeholders
103
+ %span-#{nth($columns, $a)}-large-gutter {
104
+ flex: 0 1 calc(#{100% / $span} - #{$large-gutter});
105
+ }
106
+
107
+ @if length($columns) % $a == 0 {
108
+
109
+ // Container-declared columns
110
+ .#{nth($columns, $a)}-columns {
111
+
112
+ // No gutter
113
+ > * {
114
+ @extend %span-#{nth($columns, $span)};
115
+ }
116
+
117
+ // Regular gutter
118
+ &.gutter > * {
119
+ @extend %span-#{nth($columns, $span)}-gutter;
120
+ }
121
+
122
+ // Small gutter
123
+ &.small-gutter > * {
124
+ @extend %span-#{nth($columns, $span)}-small-gutter;
125
+ }
126
+
127
+ // Large gutter
128
+ &.large-gutter > * {
129
+ @extend %span-#{nth($columns, $span)}-large-gutter;
130
+ }
131
+ }
132
+ }
133
+
134
+ // Loop through columns again
135
+ @for $b from 1 through length($columns) {
136
+
137
+ // Only create usable classnames
138
+ @if $a <= $b and length($columns) % $b == 0 {
139
+
140
+ // Define placeholder key
141
+ $key: length($columns) * ($a / $b);
142
+
143
+ // No gutter
144
+ .#{nth($columns, $a)}-of-#{nth($columns, $b)} {
145
+ @extend %span-#{nth($columns, $key)};
146
+ }
147
+
148
+ // Regular gutter
149
+ .gutter > .#{nth($columns, $a)}-of-#{nth($columns, $b)} {
150
+ @extend %span-#{nth($columns, $key)}-gutter;
151
+ }
152
+
153
+ // Small gutter
154
+ .small-gutter > .#{nth($columns, $a)}-of-#{nth($columns, $b)} {
155
+ @extend %span-#{nth($columns, $key)}-small-gutter;
156
+ }
157
+
158
+ // Large gutter
159
+ .large-gutter > .#{nth($columns, $a)}-of-#{nth($columns, $b)} {
160
+ @extend %span-#{nth($columns, $key)}-large-gutter;
161
+ }
162
+ }
163
+ }
164
+ }