spuit 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +11 -0
  3. data/.gitignore +70 -0
  4. data/.npmignore +9 -0
  5. data/Gemfile +4 -0
  6. data/README.md +16 -0
  7. data/Rakefile +1 -0
  8. data/assets/javascripts/index.js +2 -0
  9. data/assets/javascripts/spuit/Common.js +316 -0
  10. data/assets/javascripts/spuit/extend.js +46 -0
  11. data/assets/stylesheets/spuit/components/_body.sass +175 -0
  12. data/assets/stylesheets/spuit/components/_button.sass +116 -0
  13. data/assets/stylesheets/spuit/components/_form.sass +44 -0
  14. data/assets/stylesheets/spuit/components/_gist.sass +57 -0
  15. data/assets/stylesheets/spuit/components/_grids.sass +44 -0
  16. data/assets/stylesheets/spuit/components/_icon.scss +68 -0
  17. data/assets/stylesheets/spuit/components/_markdown.sass +182 -0
  18. data/assets/stylesheets/spuit/components/_messages.sass +18 -0
  19. data/assets/stylesheets/spuit/components/_shoulder.sass +13 -0
  20. data/assets/stylesheets/spuit/components/_split.sass +32 -0
  21. data/assets/stylesheets/spuit/components/_triangle.sass +40 -0
  22. data/assets/stylesheets/spuit/components/_wordwrap-fadeout.sass +19 -0
  23. data/assets/stylesheets/spuit/components/_wrap.sass +22 -0
  24. data/assets/stylesheets/spuit/elements/_checkbox.sass +46 -0
  25. data/assets/stylesheets/spuit/elements/_dl.sass +30 -0
  26. data/assets/stylesheets/spuit/elements/_fieldset.sass +46 -0
  27. data/assets/stylesheets/spuit/elements/_hr.sass +36 -0
  28. data/assets/stylesheets/spuit/elements/_input.sass +27 -0
  29. data/assets/stylesheets/spuit/elements/_radio.sass +47 -0
  30. data/assets/stylesheets/spuit/elements/_select.sass +54 -0
  31. data/assets/stylesheets/spuit/elements/_table.sass +58 -0
  32. data/assets/stylesheets/spuit/includes/_animations.scss +55 -0
  33. data/assets/stylesheets/spuit/includes/_grid.scss +345 -0
  34. data/assets/stylesheets/spuit/includes/_hiddens.scss +17 -0
  35. data/assets/stylesheets/spuit/includes/_normalize.scss +467 -0
  36. data/assets/stylesheets/spuit/includes/_spacers.scss +79 -0
  37. data/assets/stylesheets/spuit/includes/_spuit-utils.scss +11 -0
  38. data/assets/stylesheets/spuit/includes/_stickey-footer.scss +18 -0
  39. data/assets/stylesheets/spuit/includes/_webfonts.scss +30 -0
  40. data/assets/stylesheets/spuit/modules/_background-image.scss +63 -0
  41. data/assets/stylesheets/spuit/modules/_breakpoints.scss +19 -0
  42. data/assets/stylesheets/spuit/modules/_clearfix.scss +7 -0
  43. data/assets/stylesheets/spuit/modules/_fa.scss +28 -0
  44. data/assets/stylesheets/spuit/modules/_font-face.scss +31 -0
  45. data/assets/stylesheets/spuit/modules/_hide-text.scss +9 -0
  46. data/assets/stylesheets/spuit/modules/_inherit.scss +6 -0
  47. data/assets/stylesheets/spuit/modules/_reset.scss +55 -0
  48. data/assets/stylesheets/spuit/modules/_text-overflow.scss +15 -0
  49. data/assets/stylesheets/spuit/modules/_word-break.scss +11 -0
  50. data/assets/stylesheets/spuit/shortcuts/_absolute.scss +17 -0
  51. data/assets/stylesheets/spuit/shortcuts/_centering.scss +6 -0
  52. data/assets/stylesheets/spuit/shortcuts/_disc.scss +6 -0
  53. data/assets/stylesheets/spuit/variables/_colors.scss +3 -0
  54. data/assets/stylesheets/spuit/variables/_defaults.scss +3 -0
  55. data/assets/stylesheets/spuit/variables/_fonts.scss +6 -0
  56. data/assets/stylesheets/spuit/variables/_media-queries.scss +31 -0
  57. data/assets/stylesheets/spuit/variables/_svgs.scss +7 -0
  58. data/assets/stylesheets/spuit/variables/_timing-functions.sass +37 -0
  59. data/assets/stylesheets/styles.scss +164 -0
  60. data/assets/stylesheets/styles/config/_mixins.scss +23 -0
  61. data/assets/stylesheets/styles/config/_variables.scss +4 -0
  62. data/dist/favicon.png +0 -0
  63. data/dist/index.html +307 -0
  64. data/dist/javascripts/scripts.min.js +2 -0
  65. data/dist/javascripts/scripts.min.js.map +1 -0
  66. data/dist/stylesheets/styles.css +1 -0
  67. data/gulp/README.md +7 -0
  68. data/gulp/tasks/watch.js +79 -0
  69. data/gulpfile.js +2 -0
  70. data/lib/spuit.rb +41 -0
  71. data/lib/spuit/engine.rb +5 -0
  72. data/lib/spuit/generator.rb +80 -0
  73. data/lib/spuit/version.rb +3 -0
  74. data/package.json +38 -0
  75. data/spuit.gemspec +23 -0
  76. data/spuit.scss +47 -0
  77. metadata +147 -0
@@ -0,0 +1,79 @@
1
+ /*
2
+ from: https://github.com/twbs/bootstrap/blob/v4-dev/scss/utilities/_spacing.scss
3
+ */
4
+
5
+ // @include include-spacers
6
+ @mixin include-spacers {
7
+ @at-root {
8
+ $spacer: 1rem !default;
9
+ $spacer-x: $spacer !default;
10
+ $spacer-y: $spacer !default;
11
+ $spacers: (
12
+ 0: (
13
+ x: 0,
14
+ y: 0
15
+ ),
16
+ 1: (
17
+ x: ($spacer-x * .25),
18
+ y: ($spacer-y * .25)
19
+ ),
20
+ 2: (
21
+ x: ($spacer-x * .5),
22
+ y: ($spacer-y * .5)
23
+ ),
24
+ 3: (
25
+ x: $spacer-x,
26
+ y: $spacer-y
27
+ ),
28
+ 4: (
29
+ x: ($spacer-x * 1.5),
30
+ y: ($spacer-y * 1.5)
31
+ ),
32
+ 5: (
33
+ x: ($spacer-x * 3),
34
+ y: ($spacer-y * 3)
35
+ )
36
+ ) !default;
37
+
38
+ @each $breakpoint in map-keys($media-breakpoints) {
39
+ @include breakpoint-up($breakpoint) {
40
+
41
+ @each $prop, $abbrev in (margin: m, padding: p) {
42
+ @each $size, $lengths in $spacers {
43
+ $length-x: map-get($lengths, x);
44
+ $length-y: map-get($lengths, y);
45
+
46
+ .#{$abbrev}-#{$size} { #{$prop}: $length-y $length-x !important; }
47
+ .#{$abbrev}t-#{$size} { #{$prop}-top: $length-y !important; }
48
+ .#{$abbrev}r-#{$size} { #{$prop}-right: $length-x !important; }
49
+ .#{$abbrev}b-#{$size} { #{$prop}-bottom: $length-y !important; }
50
+ .#{$abbrev}l-#{$size} { #{$prop}-left: $length-x !important; }
51
+ .#{$abbrev}x-#{$size} {
52
+ #{$prop}-right: $length-x !important;
53
+ #{$prop}-left: $length-x !important;
54
+ }
55
+ .#{$abbrev}y-#{$size} {
56
+ #{$prop}-top: $length-y !important;
57
+ #{$prop}-bottom: $length-y !important;
58
+ }
59
+ }
60
+ }
61
+
62
+ // Some special margin utils
63
+ .m-auto { margin: auto !important; }
64
+ .mt-auto { margin-top: auto !important; }
65
+ .mr-auto { margin-right: auto !important; }
66
+ .mb-auto { margin-bottom: auto !important; }
67
+ .ml-auto { margin-left: auto !important; }
68
+ .mx-auto {
69
+ margin-right: auto !important;
70
+ margin-left: auto !important;
71
+ }
72
+ .my-auto {
73
+ margin-top: auto !important;
74
+ margin-bottom: auto !important;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,11 @@
1
+ // @include include-spuit-utils
2
+ @mixin include-spuit-utils {
3
+ @at-root {
4
+ .c {
5
+ clear: both;
6
+ }
7
+ .clearfix {
8
+ @include clearfix;
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,18 @@
1
+ // @include include-stickey-footer
2
+ @mixin include-stickey-footer($footer-height: 100px, $class: '.footer') {
3
+ @at-root {
4
+ html {
5
+ position: relative;
6
+ min-height: 100%;
7
+ }
8
+ body {
9
+ margin-bottom: $footer-height;
10
+ }
11
+ body > #{$class} {
12
+ position: absolute;
13
+ bottom: 0;
14
+ width: 100%;
15
+ height: $footer-height;
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,30 @@
1
+ // @include include-fa
2
+ @mixin include-fa {
3
+ @at-root {
4
+ @import url('//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css');
5
+ }
6
+ }
7
+
8
+ // @include include-noto
9
+ // font-family: 'Noto Sans Japanese', san-serif;
10
+ @mixin include-noto {
11
+ @at-root {
12
+ @import url('//fonts.googleapis.com/earlyaccess/notosansjapanese.css');
13
+ }
14
+ }
15
+
16
+ // @include include-roboto
17
+ // font-family: 'Roboto', sans-serif;
18
+ @mixin include-roboto {
19
+ @at-root {
20
+ @import url('//fonts.googleapis.com/css?family=Roboto');
21
+ }
22
+ }
23
+
24
+ // @include include-opensans
25
+ // font-family: 'Open Sans', sans-serif;
26
+ @mixin include-opensans {
27
+ @at-root {
28
+ @import url('//fonts.googleapis.com/css?family=Open+Sans:400,300,700')
29
+ }
30
+ }
@@ -0,0 +1,63 @@
1
+ @mixin background-image($w: 50px, $h: 50px, $path: '/images/xxx', $extension: 'png') {
2
+ background-image: url('#{$path}.#{$extension}');
3
+ background-position: center center;
4
+ background-repeat: no-repeat;
5
+ background-size: cover;
6
+ display: inline-block;
7
+ width: $w;
8
+ height: $h;
9
+ @include breakpoint-retina {
10
+ background-image: url('#{$path}@2x.#{$extension}');
11
+ }
12
+ }
13
+
14
+ @mixin replace-background-image($w: 50px, $h: 50px, $path: '/images/xxx', $extension: 'png') {
15
+ @include hide-text;
16
+ display: inline-block;
17
+ width: $w;
18
+ line-height: $h;
19
+ height: $h;
20
+ position: relative;
21
+ vertical-align: middle;
22
+
23
+ &:after {
24
+ @include background-image($w, $h, $path);
25
+ content: '';
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ }
30
+ }
31
+
32
+ //for rails
33
+ @mixin background-image-url($w: 50px, $h: 50px, $path: '/images/xxx', $extension: 'png') {
34
+ display: inline-block;
35
+ background-image: image-url('#{$path}.#{$extension}');
36
+ background-position: center center;
37
+ background-repeat: no-repeat;
38
+ background-size: cover;
39
+ width: $w;
40
+ height: $h;
41
+ @include breakpoint-retina {
42
+ background-image: image-url('#{$path}@2x.#{$extension}');
43
+ }
44
+ }
45
+
46
+ //for rails
47
+ @mixin replace-background-image-url($w: 50px, $h: 50px, $path: '/images/xxx', $extension: 'png') {
48
+ @include hide-text;
49
+ display: inline-block;
50
+ width: $w;
51
+ line-height: $h;
52
+ height: $h;
53
+ position: relative;
54
+ vertical-align: middle;
55
+
56
+ &:after {
57
+ @include background-image-url($w, $h, $path);
58
+ content: '';
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ }
63
+ }
@@ -0,0 +1,19 @@
1
+ @mixin breakpoint-down($name: md, $breakpoints: $grid-breakpoints) {
2
+ $map: map-get($breakpoints, $name);
3
+ @media (max-width: $map) {
4
+ @content;
5
+ }
6
+ }
7
+
8
+ @mixin breakpoint-up($name: md, $breakpoints: $grid-breakpoints) {
9
+ $map: map-get($breakpoints, $name);
10
+ @media (min-width: $map + 1px) {
11
+ @content;
12
+ }
13
+ }
14
+
15
+ @mixin breakpoint-retina {
16
+ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
17
+ @content;
18
+ }
19
+ }
@@ -0,0 +1,7 @@
1
+ @mixin clearfix {
2
+ &:after {
3
+ content: '';
4
+ display: table;
5
+ clear: both;
6
+ }
7
+ }
@@ -0,0 +1,28 @@
1
+ @mixin fa($content: '\f105') {
2
+ display: inline-block;
3
+ font-family: FontAwesome;
4
+ font-style: normal;
5
+ font-weight: normal;
6
+ line-height: 1;
7
+ text-indent: 0;
8
+ @if ($content) {
9
+ content: $content;
10
+ }
11
+ }
12
+
13
+ @mixin replace-fa($content: '\f105', $size: 1rem, $r: 1rem) {
14
+ @include hide-text;
15
+ display: inline-block;
16
+ width: $r;
17
+ height: $r;
18
+ line-height: $r;
19
+
20
+ &:after {
21
+ @include fa($content);
22
+ font-size: $size;
23
+ width: $r;
24
+ height: $r;
25
+ line-height: $r;
26
+ text-align: center;
27
+ }
28
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ example:
3
+ @include font-face('fontello', 'fontello/fontello');
4
+ @mixin font-fontello($size: 1rem, $line-height: normal, $weight: normal) {
5
+ font-family: 'fontello';
6
+ font-size: $size;
7
+ font-weight: $weight;
8
+ line-height: $line-height;
9
+ }
10
+ */
11
+
12
+ @mixin font-face($name, $path) {
13
+ @at-root {
14
+ @font-face {
15
+ font-family: $name;
16
+ src: url('#{$path}.eot');
17
+ src: url('#{$path}.eot?iefix') format('eot'), url('#{$path}.woff') format("woff"), url('#{$path}.ttf') format('truetype'), url('#{$path}.svg#font') format('svg');
18
+ }
19
+ }
20
+ }
21
+
22
+ //for rails
23
+ @mixin font-face-url($name, $path) {
24
+ @at-root {
25
+ @font-face {
26
+ font-family: $name;
27
+ src: font-url('#{$path}.eot');
28
+ src: font-url('#{$path}.eot?iefix') format('eot'), font-url('#{$path}.woff') format("woff"), font-url('#{$path}.ttf') format('truetype'), font-url('#{$path}.svg#font') format('svg');
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,9 @@
1
+ @mixin hide-text {
2
+ overflow: hidden;
3
+ &:before {
4
+ content: '';
5
+ display: block;
6
+ width: 0;
7
+ height: 100%;
8
+ }
9
+ }
@@ -0,0 +1,6 @@
1
+ @mixin inherit() {
2
+ color: inherit;
3
+ font-family: inherit;
4
+ font-style: inherit;
5
+ font-weight: inherit;
6
+ }
@@ -0,0 +1,55 @@
1
+ @mixin reset-form($c: transparent) {
2
+ margin: 0;
3
+ padding: 0;
4
+ border-radius: 0;
5
+ background-image: linear-gradient(transparent, transparent);
6
+ background: transparent;
7
+ appearance: none;
8
+ border: none;
9
+ outline: none;
10
+ text-decoration: none;
11
+ &:focus {
12
+ border: none;
13
+ outline: none;
14
+ }
15
+ }
16
+
17
+ @mixin reset-ul() {
18
+ margin: 0;
19
+ padding: 0;
20
+ list-style: none;
21
+ display: inline-block;
22
+ > li {
23
+ display: inline-block;
24
+ }
25
+ }
26
+
27
+ @mixin reset-img() {
28
+ margin: 0;
29
+ padding: 0;
30
+ line-height: 0;
31
+ vertical-align: baseline;
32
+ border: none;
33
+ }
34
+
35
+ @mixin reset-heading() {
36
+ margin: 0;
37
+ padding: 0;
38
+ display: inline-block;
39
+ border: none;
40
+ }
41
+
42
+ @mixin reset-button() {
43
+ margin: 0;
44
+ padding: 0;
45
+ line-height: 1;
46
+ vertical-align: baseline;
47
+ border: none;
48
+ background-color: transparent;
49
+ cursor: pointer;
50
+ &:focus,
51
+ &:active {
52
+ border: none;
53
+ outline: none;
54
+ }
55
+ }
@@ -0,0 +1,15 @@
1
+ @mixin text-overflow($line: 1) {
2
+ @if $line == 1 {
3
+ overflow: hidden;
4
+ white-space: nowrap;
5
+ text-overflow: ellipsis;
6
+ } @else {
7
+ // FIXME: atoprefixerがwebkit-box-orientを消してしまう
8
+ // work: IE9^, Chrome, Safari
9
+ // not work: Firefox
10
+ display: -webkit-box;
11
+ -webkit-box-orient: vertical;
12
+ -webkit-line-clamp: $line;
13
+ overflow: hidden;
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ @mixin word-break($break: true) {
2
+ @if $break == true {
3
+ white-space: normal;
4
+ word-break: break-all;
5
+ word-wrap: break-word;
6
+ } @else {
7
+ white-space: nowrap;
8
+ word-break: keep-all;
9
+ word-wrap: normal;
10
+ }
11
+ }
@@ -0,0 +1,17 @@
1
+ @mixin absolute($l: 0, $t: 0, $positionX: 'left', $positionY: 'top') {
2
+ position: absolute;
3
+ @if $positionX == 'left' {
4
+ left: $l;
5
+ right: auto;
6
+ } @else {
7
+ left: auto;
8
+ right: $l;
9
+ }
10
+ @if $positionY == 'top' {
11
+ top: $t;
12
+ bottom: auto;
13
+ } @else {
14
+ top: auto;
15
+ bottom: $t;
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ @mixin centering($pos: absolute, $x: 50%, $y: 50%) {
2
+ transform: translateX(-$x) translateY(-$y);
3
+ position: $pos;
4
+ top: $y;
5
+ left: $x;
6
+ }
@@ -0,0 +1,6 @@
1
+ @mixin disc($r: 40px) {
2
+ border-radius: $r;
3
+ width: $r;
4
+ height: $r;
5
+ line-height: $r;
6
+ }
@@ -0,0 +1,3 @@
1
+ $color-twitter: #1DA1F2;
2
+ $color-hatena: #2D92BA;
3
+ $color-facebook: #3C5999;