cask 0.2.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.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.hound.yml +3 -0
- data/.scss-lint.yml +237 -0
- data/CONTRIBUTING.md +61 -0
- data/Gemfile +4 -0
- data/Gulpfile.js +41 -0
- data/LICENSE +21 -0
- data/README.md +54 -0
- data/Rakefile +1 -0
- data/app/assets/stylesheets/_cask.scss +12 -0
- data/app/assets/stylesheets/_variables.scss +31 -0
- data/app/assets/stylesheets/functions/_all.scss +5 -0
- data/app/assets/stylesheets/functions/_grid-calc.scss +13 -0
- data/app/assets/stylesheets/functions/_grid-column-ratio.scss +11 -0
- data/app/assets/stylesheets/functions/_grid-parse-column-count.scss +13 -0
- data/app/assets/stylesheets/mixins/_all.scss +8 -0
- data/app/assets/stylesheets/mixins/_grid-column.scss +17 -0
- data/app/assets/stylesheets/mixins/_grid-gutter.scss +17 -0
- data/app/assets/stylesheets/mixins/_grid-is-zero-error.scss +7 -0
- data/app/assets/stylesheets/mixins/_grid-push.scss +15 -0
- data/app/assets/stylesheets/mixins/_grid-row.scss +11 -0
- data/app/assets/stylesheets/mixins/_grid-shift.scss +16 -0
- data/bin/console +6 -0
- data/bin/setup +2 -0
- data/cask.gemspec +27 -0
- data/contrib/stylesheets/_example.scss +200 -0
- data/contrib/stylesheets/base/_base.scss +15 -0
- data/contrib/stylesheets/base/_buttons.scss +35 -0
- data/contrib/stylesheets/base/_forms.scss +90 -0
- data/contrib/stylesheets/base/_lists.scss +19 -0
- data/contrib/stylesheets/base/_tables.scss +24 -0
- data/contrib/stylesheets/base/_typography.scss +48 -0
- data/contrib/stylesheets/base/_variables.scss +43 -0
- data/contrib/stylesheets/styles.scss +11 -0
- data/contrib/views/index.haml +149 -0
- data/lib/cask.rb +19 -0
- data/lib/cask/engine.rb +5 -0
- data/lib/cask/version.rb +3 -0
- data/package.json +36 -0
- metadata +125 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
#{$all-buttons} {
|
2
|
+
appearance: none;
|
3
|
+
background-color: $action-color;
|
4
|
+
border: 0;
|
5
|
+
border-radius: $base-border-radius;
|
6
|
+
color: #fff;
|
7
|
+
cursor: pointer;
|
8
|
+
display: inline-block;
|
9
|
+
font-family: $base-font-family;
|
10
|
+
font-size: $base-font-size;
|
11
|
+
-webkit-font-smoothing: antialiased;
|
12
|
+
font-weight: 600;
|
13
|
+
line-height: 1;
|
14
|
+
padding: $small-spacing $base-spacing;
|
15
|
+
text-decoration: none;
|
16
|
+
transition: background-color $base-duration $base-timing;
|
17
|
+
user-select: none;
|
18
|
+
vertical-align: middle;
|
19
|
+
white-space: nowrap;
|
20
|
+
|
21
|
+
&:hover,
|
22
|
+
&:focus {
|
23
|
+
background-color: shade($action-color, 20%);
|
24
|
+
color: #fff;
|
25
|
+
}
|
26
|
+
|
27
|
+
&:disabled {
|
28
|
+
cursor: not-allowed;
|
29
|
+
opacity: 0.5;
|
30
|
+
|
31
|
+
&:hover {
|
32
|
+
background-color: $action-color;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
fieldset {
|
2
|
+
background-color: $base-background-color;
|
3
|
+
border: $base-border;
|
4
|
+
margin: 0 0 $small-spacing;
|
5
|
+
padding: $base-spacing;
|
6
|
+
}
|
7
|
+
|
8
|
+
input,
|
9
|
+
label,
|
10
|
+
select {
|
11
|
+
display: block;
|
12
|
+
font-family: $base-font-family;
|
13
|
+
font-size: $base-font-size;
|
14
|
+
}
|
15
|
+
|
16
|
+
label {
|
17
|
+
font-weight: 600;
|
18
|
+
margin-bottom: $small-spacing / 2;
|
19
|
+
|
20
|
+
&.required::after {
|
21
|
+
content: "*";
|
22
|
+
}
|
23
|
+
|
24
|
+
abbr {
|
25
|
+
display: none;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
#{$all-text-inputs},
|
30
|
+
select[multiple=multiple] {
|
31
|
+
background-color: $base-background-color;
|
32
|
+
border: $base-border;
|
33
|
+
border-radius: $base-border-radius;
|
34
|
+
box-shadow: $form-box-shadow;
|
35
|
+
box-sizing: border-box;
|
36
|
+
font-family: $base-font-family;
|
37
|
+
font-size: $base-font-size;
|
38
|
+
margin-bottom: $small-spacing;
|
39
|
+
padding: $base-spacing / 3;
|
40
|
+
transition: border-color $base-duration $base-timing;
|
41
|
+
width: 100%;
|
42
|
+
|
43
|
+
&:hover {
|
44
|
+
border-color: shade($base-border-color, 20%);
|
45
|
+
}
|
46
|
+
|
47
|
+
&:focus {
|
48
|
+
border-color: $action-color;
|
49
|
+
box-shadow: $form-box-shadow-focus;
|
50
|
+
outline: none;
|
51
|
+
}
|
52
|
+
|
53
|
+
&:disabled {
|
54
|
+
background-color: shade($base-background-color, 5%);
|
55
|
+
cursor: not-allowed;
|
56
|
+
|
57
|
+
&:hover {
|
58
|
+
border: $base-border;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
textarea {
|
64
|
+
resize: vertical;
|
65
|
+
}
|
66
|
+
|
67
|
+
input[type="search"] {
|
68
|
+
appearance: none;
|
69
|
+
}
|
70
|
+
|
71
|
+
input[type="checkbox"],
|
72
|
+
input[type="radio"] {
|
73
|
+
display: inline;
|
74
|
+
margin-right: $small-spacing / 2;
|
75
|
+
|
76
|
+
+ label {
|
77
|
+
display: inline-block;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
input[type="file"] {
|
82
|
+
margin-bottom: $small-spacing;
|
83
|
+
width: 100%;
|
84
|
+
}
|
85
|
+
|
86
|
+
select {
|
87
|
+
margin-bottom: $base-spacing;
|
88
|
+
max-width: 100%;
|
89
|
+
width: auto;
|
90
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
table {
|
2
|
+
border-collapse: collapse;
|
3
|
+
margin: $small-spacing 0;
|
4
|
+
table-layout: fixed;
|
5
|
+
width: 100%;
|
6
|
+
}
|
7
|
+
|
8
|
+
th {
|
9
|
+
border-bottom: 1px solid shade($base-border-color, 25%);
|
10
|
+
font-weight: 600;
|
11
|
+
padding: $small-spacing 0;
|
12
|
+
text-align: left;
|
13
|
+
}
|
14
|
+
|
15
|
+
td {
|
16
|
+
border-bottom: $base-border;
|
17
|
+
padding: $small-spacing 0;
|
18
|
+
}
|
19
|
+
|
20
|
+
tr,
|
21
|
+
td,
|
22
|
+
th {
|
23
|
+
vertical-align: middle;
|
24
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
body {
|
2
|
+
color: $base-font-color;
|
3
|
+
font-family: $base-font-family;
|
4
|
+
font-size: $base-font-size;
|
5
|
+
line-height: $base-line-height;
|
6
|
+
}
|
7
|
+
|
8
|
+
h1,
|
9
|
+
h2,
|
10
|
+
h3,
|
11
|
+
h4,
|
12
|
+
h5,
|
13
|
+
h6 {
|
14
|
+
font-family: $heading-font-family;
|
15
|
+
font-size: $base-font-size;
|
16
|
+
line-height: $heading-line-height;
|
17
|
+
margin: 0 0 $small-spacing;
|
18
|
+
}
|
19
|
+
|
20
|
+
p {
|
21
|
+
margin: 0 0 $small-spacing;
|
22
|
+
}
|
23
|
+
|
24
|
+
a {
|
25
|
+
color: $action-color;
|
26
|
+
text-decoration: none;
|
27
|
+
transition: color $base-duration $base-timing;
|
28
|
+
|
29
|
+
&:active,
|
30
|
+
&:focus,
|
31
|
+
&:hover {
|
32
|
+
color: shade($action-color, 25%);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
hr {
|
37
|
+
border-bottom: $base-border;
|
38
|
+
border-left: 0;
|
39
|
+
border-right: 0;
|
40
|
+
border-top: 0;
|
41
|
+
margin: $base-spacing 0;
|
42
|
+
}
|
43
|
+
|
44
|
+
img,
|
45
|
+
picture {
|
46
|
+
margin: 0;
|
47
|
+
max-width: 100%;
|
48
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
// Typography
|
2
|
+
$base-font-family: $helvetica;
|
3
|
+
$heading-font-family: $base-font-family;
|
4
|
+
$monospace-font-family: $monospace;
|
5
|
+
|
6
|
+
// Font Sizes
|
7
|
+
$base-font-size: 1em;
|
8
|
+
|
9
|
+
// Line height
|
10
|
+
$base-line-height: 1.5;
|
11
|
+
$heading-line-height: 1.2;
|
12
|
+
|
13
|
+
// Other Sizes
|
14
|
+
$base-border-radius: 3px;
|
15
|
+
$base-spacing: $base-line-height * 1em;
|
16
|
+
$small-spacing: $base-spacing / 2;
|
17
|
+
$base-z-index: 0;
|
18
|
+
|
19
|
+
// Colors
|
20
|
+
$blue: #477dca;
|
21
|
+
$dark-gray: #333;
|
22
|
+
$medium-gray: #999;
|
23
|
+
$light-gray: #ddd;
|
24
|
+
|
25
|
+
// Font Colors
|
26
|
+
$base-font-color: $dark-gray;
|
27
|
+
$action-color: $blue;
|
28
|
+
|
29
|
+
// Border
|
30
|
+
$base-border-color: $light-gray;
|
31
|
+
$base-border: 1px solid $base-border-color;
|
32
|
+
|
33
|
+
// Background Colors
|
34
|
+
$base-background-color: #fff;
|
35
|
+
$secondary-background-color: tint($base-border-color, 75%);
|
36
|
+
|
37
|
+
// Forms
|
38
|
+
$form-box-shadow: inset 0 1px 3px rgba(#000, 0.06);
|
39
|
+
$form-box-shadow-focus: $form-box-shadow, 0 0 5px adjust-color($action-color, $lightness: -5%, $alpha: -0.3);
|
40
|
+
|
41
|
+
// Animations
|
42
|
+
$base-duration: 150ms;
|
43
|
+
$base-timing: ease;
|
@@ -0,0 +1,149 @@
|
|
1
|
+
!!!
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{ charset: "utf-8" }
|
5
|
+
%meta{ content: "IE=edge,chrome=1", http: { equiv: "X-UA-Compatible" } }
|
6
|
+
%meta{ name: "viewport", content: "width=device-width, initial-scale=1" }
|
7
|
+
%meta{ content: "noindex, nofollow", name: "robots" }
|
8
|
+
%title
|
9
|
+
"Cask"
|
10
|
+
%link{ href: "styles.css", rel: "stylesheet", type: "text/css" }
|
11
|
+
|
12
|
+
%body
|
13
|
+
%header.header
|
14
|
+
%h1.title
|
15
|
+
Cask
|
16
|
+
%small
|
17
|
+
A simple relible float based grid system.
|
18
|
+
%small
|
19
|
+
%a.contact{ href: "https://github.com/whmii/cask" }
|
20
|
+
github
|
21
|
+
%a.contact{ href: "https://twitter.com/WHMII" }
|
22
|
+
@whmii
|
23
|
+
%ul.description
|
24
|
+
%li
|
25
|
+
Cask is only ~84 lines of code so its basically fully knowable
|
26
|
+
%li
|
27
|
+
Because of its simplicity there is virtually no “where is this coming from!?”
|
28
|
+
%li
|
29
|
+
The syntax for media queries is greatly simplified
|
30
|
+
%li
|
31
|
+
There is no use of relative positioning or nth child selectors
|
32
|
+
%li
|
33
|
+
Cask is built around defining as few attributes as possible
|
34
|
+
%li
|
35
|
+
It’s easy to use in conjunction with flex-box
|
36
|
+
%main.example
|
37
|
+
%section
|
38
|
+
%h1.section-title
|
39
|
+
Some Examples
|
40
|
+
.row
|
41
|
+
.col-12
|
42
|
+
.content
|
43
|
+
%code
|
44
|
+
@include grid-column($columns: 12);
|
45
|
+
.row
|
46
|
+
- 2.times do
|
47
|
+
.col-6
|
48
|
+
.content
|
49
|
+
%code
|
50
|
+
@include grid-column($columns: 6);
|
51
|
+
.row
|
52
|
+
- 3.times do
|
53
|
+
.col-4
|
54
|
+
.content
|
55
|
+
%code
|
56
|
+
$columns: 4
|
57
|
+
.row
|
58
|
+
- 4.times do
|
59
|
+
.col-3
|
60
|
+
.content
|
61
|
+
%code
|
62
|
+
3
|
63
|
+
.row
|
64
|
+
- 6.times do
|
65
|
+
.col-2
|
66
|
+
.content
|
67
|
+
%code
|
68
|
+
2
|
69
|
+
.row
|
70
|
+
- 12.times do
|
71
|
+
.col-1
|
72
|
+
.content
|
73
|
+
%code
|
74
|
+
1
|
75
|
+
%section
|
76
|
+
%h1.section-title
|
77
|
+
Centered Grids
|
78
|
+
.row
|
79
|
+
.col-6-center
|
80
|
+
.content
|
81
|
+
%code
|
82
|
+
@include grid-column($columns: 6, $center: true);
|
83
|
+
%section
|
84
|
+
%h1.section-title
|
85
|
+
Push Grids
|
86
|
+
.row
|
87
|
+
.col-5-push
|
88
|
+
.content
|
89
|
+
%code
|
90
|
+
@include grid-push($push: 2);
|
91
|
+
%section
|
92
|
+
%h1.section-title
|
93
|
+
Shift Grids (reordering)
|
94
|
+
.row
|
95
|
+
.col-4-shift-1
|
96
|
+
.content
|
97
|
+
%code
|
98
|
+
[first] @include grid-shift($shift: 4);
|
99
|
+
.col-4-shift-2
|
100
|
+
.content
|
101
|
+
%code
|
102
|
+
[second] @include grid-shift($shift: -4);
|
103
|
+
%section
|
104
|
+
%h1.section-title
|
105
|
+
Collapsed & Nested Grids
|
106
|
+
.row
|
107
|
+
.content-label
|
108
|
+
.col-6
|
109
|
+
.content-label
|
110
|
+
6
|
111
|
+
.content
|
112
|
+
%code
|
113
|
+
$columns: 6
|
114
|
+
.col-6-collapse
|
115
|
+
.content-label
|
116
|
+
6
|
117
|
+
.col-6
|
118
|
+
.content-label
|
119
|
+
6
|
120
|
+
.content
|
121
|
+
%code
|
122
|
+
$columns: 6
|
123
|
+
.col-6-collapse
|
124
|
+
.content-label
|
125
|
+
6
|
126
|
+
.col-6
|
127
|
+
.content-label
|
128
|
+
6
|
129
|
+
.content
|
130
|
+
%code
|
131
|
+
6
|
132
|
+
.col-6
|
133
|
+
.content-label
|
134
|
+
6
|
135
|
+
.content
|
136
|
+
%code
|
137
|
+
6
|
138
|
+
%section
|
139
|
+
%h1.section-title
|
140
|
+
Custom sub-grids
|
141
|
+
.row
|
142
|
+
.col-2-of-5
|
143
|
+
.content
|
144
|
+
%code
|
145
|
+
@include grid-column($columns:2 of 5);
|
146
|
+
.col-3-of-5
|
147
|
+
.content
|
148
|
+
%code
|
149
|
+
@include grid-column($columns:3 of 5);
|
data/lib/cask.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "cask/version"
|
2
|
+
|
3
|
+
module Cask
|
4
|
+
if defined?(Rails) && defined?(Rails::Engine)
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
require 'cask/engine'
|
7
|
+
end
|
8
|
+
|
9
|
+
module Rails
|
10
|
+
class Railtie < ::Rails::Railtie
|
11
|
+
rake_tasks do
|
12
|
+
load "tasks/install.rake"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
else
|
17
|
+
Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
|
18
|
+
end
|
19
|
+
end
|