shevy 1.0.1 → 2.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.
- checksums.yaml +4 -4
- data/.gitignore +4 -9
- data/Gruntfile.js +59 -0
- data/LICENSE.md +21 -0
- data/README.md +173 -19
- data/bower.json +35 -0
- data/core/_shevy.scss +12 -0
- data/core/_shevy_functions.scss +128 -0
- data/core/_shevy_mixins.scss +131 -0
- data/core/_shevy_variables.scss +20 -0
- data/demo/css/style.css +415 -0
- data/demo/dist/style.css +413 -0
- data/demo/index.html +126 -0
- data/demo/scss/style.scss +202 -0
- data/lib/shevy.rb +7 -5
- data/lib/shevy/generator.rb +81 -0
- data/lib/shevy/version.rb +1 -1
- data/package.json +34 -0
- data/sache.json +6 -0
- metadata +16 -6
- data/vendor/assets/stylesheets/shevy.scss +0 -13
- data/vendor/assets/stylesheets/shevy/_shevy_functions.scss +0 -39
- data/vendor/assets/stylesheets/shevy/_shevy_mixins.scss +0 -123
- data/vendor/assets/stylesheets/shevy/_shevy_variables.scss +0 -18
@@ -0,0 +1,202 @@
|
|
1
|
+
@import '../../lib/shevy';
|
2
|
+
|
3
|
+
$breakpoints: (
|
4
|
+
'alpha-prime': 478px,
|
5
|
+
'alpha': 520px,
|
6
|
+
'bravo': 769px,
|
7
|
+
'charlie': 1025px,
|
8
|
+
'delta': 1350px,
|
9
|
+
);
|
10
|
+
|
11
|
+
@mixin bp($bp, $min_max: 'min') {
|
12
|
+
$value: map-get($breakpoints, $bp);
|
13
|
+
|
14
|
+
@if $value != null {
|
15
|
+
@media only screen and (#{$min_max}-width: $value) {
|
16
|
+
@content;
|
17
|
+
}
|
18
|
+
} @else {
|
19
|
+
@warn "Unfortunately, `#{bp}` wasn't found in $breakpoints.";
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
//////////////////////////////
|
24
|
+
// Base
|
25
|
+
//////////////////////////////
|
26
|
+
*,
|
27
|
+
*:before,
|
28
|
+
*:after {
|
29
|
+
box-sizing: inherit;
|
30
|
+
}
|
31
|
+
|
32
|
+
* {
|
33
|
+
margin: 0;
|
34
|
+
padding: 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
html {
|
38
|
+
box-sizing: border-box;
|
39
|
+
font-size: 100%;
|
40
|
+
}
|
41
|
+
|
42
|
+
body {
|
43
|
+
font-family: sans-serif;
|
44
|
+
}
|
45
|
+
|
46
|
+
.container {
|
47
|
+
width: 90%;
|
48
|
+
margin: 1em auto;
|
49
|
+
|
50
|
+
@include bp(alpha) {
|
51
|
+
width: 67%;
|
52
|
+
}
|
53
|
+
|
54
|
+
@include bp(charlie) {
|
55
|
+
width: 50%;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
.footer {
|
60
|
+
margin-bottom: bs(2);
|
61
|
+
}
|
62
|
+
|
63
|
+
//////////////////////////////
|
64
|
+
// Typography
|
65
|
+
//////////////////////////////
|
66
|
+
@include headings;
|
67
|
+
@include paragraph;
|
68
|
+
|
69
|
+
//////////////////////////////
|
70
|
+
// Shevy Block
|
71
|
+
//////////////////////////////
|
72
|
+
.shevy {
|
73
|
+
background-image: url(http://basehold.it/i/24/);
|
74
|
+
@include headings;
|
75
|
+
@include paragraph;
|
76
|
+
}
|
77
|
+
|
78
|
+
//////////////////////////////
|
79
|
+
// Large Block
|
80
|
+
//////////////////////////////
|
81
|
+
$large: (
|
82
|
+
'base-font-size': 15px,
|
83
|
+
'base-line-height': 2,
|
84
|
+
'base-font-scale': (6, 5, 4, 3, 2, 1)
|
85
|
+
);
|
86
|
+
|
87
|
+
.large {
|
88
|
+
background-image: url(http://basehold.it/i/30/);
|
89
|
+
@include headings($large);
|
90
|
+
@include paragraph($large);
|
91
|
+
|
92
|
+
h6 {
|
93
|
+
/* If you're clever and look at this and notice it's different,
|
94
|
+
let me tell you why. Shevy supports a half base-space so that large headings
|
95
|
+
don't have obnoxiously big margins. When you're using basehold.it,
|
96
|
+
it's nice to bump up a margin manually to get the text below back on the baseline. Kudos for finding this */
|
97
|
+
margin-bottom: bs(1.5, $large);
|
98
|
+
|
99
|
+
@include bp(alpha-prime) {
|
100
|
+
margin-bottom: bs(1, $large);
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
//////////////////////////////
|
106
|
+
// Responsive Block
|
107
|
+
//////////////////////////////
|
108
|
+
$responsive: (
|
109
|
+
'base-font-size': 14px,
|
110
|
+
'base-font-scale': (2, 1.75, 1.5, 1.25, 1, .75)
|
111
|
+
);
|
112
|
+
|
113
|
+
$responsive-alpha: (
|
114
|
+
'base-font-size': 16px,
|
115
|
+
'base-font-scale': (2, 1.75, 1.5, 1.25, 1, .75)
|
116
|
+
);
|
117
|
+
|
118
|
+
$responsive-bravo: (
|
119
|
+
'base-font-size': 1.5em,
|
120
|
+
'base-font-scale': (2.5, 2.2, 2, 1.75, 1.25, 1)
|
121
|
+
);
|
122
|
+
|
123
|
+
$responsive-charlie: (
|
124
|
+
'base-font-size': 36px,
|
125
|
+
'base-font-scale': (2.5, 2.2, 2, 1.75, 1.25, 1)
|
126
|
+
);
|
127
|
+
|
128
|
+
$responsive-delta: (
|
129
|
+
'base-font-size': 48px,
|
130
|
+
'base-font-scale': (3, 2.5, 2, 1.75, 1.25, 1)
|
131
|
+
);
|
132
|
+
|
133
|
+
.responsive {
|
134
|
+
background-image: url(http://basehold.it/i/21/);
|
135
|
+
@include headings($responsive);
|
136
|
+
@include paragraph($responsive);
|
137
|
+
|
138
|
+
@include bp(alpha) {
|
139
|
+
background-image: url(http://basehold.it/i/24/);
|
140
|
+
@include headings($responsive-alpha);
|
141
|
+
@include paragraph($responsive-alpha);
|
142
|
+
}
|
143
|
+
|
144
|
+
@include bp(bravo) {
|
145
|
+
background-image: url(http://basehold.it/i/54/);
|
146
|
+
@include headings($responsive-bravo);
|
147
|
+
@include paragraph($responsive-bravo);
|
148
|
+
}
|
149
|
+
|
150
|
+
@include bp(charlie) {
|
151
|
+
background-image: url(http://basehold.it/i/54/);
|
152
|
+
@include headings($responsive-charlie);
|
153
|
+
@include paragraph($responsive-charlie);
|
154
|
+
}
|
155
|
+
|
156
|
+
@include bp(delta) {
|
157
|
+
background-image: url(http://basehold.it/i/72/);
|
158
|
+
@include headings($responsive-delta);
|
159
|
+
@include paragraph($responsive-delta);
|
160
|
+
}
|
161
|
+
|
162
|
+
p:first-child {
|
163
|
+
|
164
|
+
@include bp(bravo) {
|
165
|
+
margin-bottom: bs(.5, $responsive-bravo);
|
166
|
+
}
|
167
|
+
|
168
|
+
@include bp(charlie) {
|
169
|
+
margin-bottom: bs(.5, $responsive-charlie);
|
170
|
+
}
|
171
|
+
|
172
|
+
@include bp(delta) {
|
173
|
+
margin-bottom: bs(.5, $responsive-delta);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
.box {
|
179
|
+
background: red;
|
180
|
+
padding: bs(2);
|
181
|
+
margin-bottom: bs();
|
182
|
+
|
183
|
+
.responsive & {
|
184
|
+
padding: bs(2, $responsive);
|
185
|
+
|
186
|
+
@include bp(alpha) {
|
187
|
+
padding: bs(2, $responsive-alpha);
|
188
|
+
}
|
189
|
+
|
190
|
+
@include bp(bravo) {
|
191
|
+
padding: bs(2, $responsive-bravo);
|
192
|
+
}
|
193
|
+
|
194
|
+
@include bp(charlie) {
|
195
|
+
padding: bs(2, $responsive-charlie);
|
196
|
+
}
|
197
|
+
|
198
|
+
@include bp(delta) {
|
199
|
+
padding: bs(2, $responsive-delta);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
data/lib/shevy.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
require "shevy/
|
1
|
+
require "shevy/generator"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
shevy_path = File.expand_path('../../core', __FILE__)
|
4
|
+
|
5
|
+
ENV["SASS_PATH"] = [
|
6
|
+
ENV["SASS_PATH"],
|
7
|
+
shevy_path
|
8
|
+
].compact.join(File::PATH_SEPARATOR)
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'shevy/version'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'thor'
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
module Shevy
|
7
|
+
class Generator < Thor
|
8
|
+
map ["-v", "--version"] => :version
|
9
|
+
|
10
|
+
desc "install", "Install Shevy into your project"
|
11
|
+
method_options :path => :string, :force => :boolean
|
12
|
+
def install
|
13
|
+
if shevy_files_already_exist? && !options[:force]
|
14
|
+
puts "Shevy files already installed, doing nothing."
|
15
|
+
else
|
16
|
+
install_files
|
17
|
+
puts "Shevy files installed to #{install_path}/"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "update", "Update Shevy"
|
22
|
+
method_options :path => :string
|
23
|
+
def update
|
24
|
+
if shevy_files_already_exist?
|
25
|
+
remove_shevy_directory
|
26
|
+
install_files
|
27
|
+
puts "Shevy files updated."
|
28
|
+
else
|
29
|
+
puts "No existing shevy installation. Doing nothing."
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "version", "Show Shevy version"
|
34
|
+
def version
|
35
|
+
say "Shevy #{Shevy::VERSION}"
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def shevy_files_already_exist?
|
41
|
+
install_path.exist?
|
42
|
+
end
|
43
|
+
|
44
|
+
def install_path
|
45
|
+
@install_path ||= if options[:path]
|
46
|
+
Pathname.new(File.join(options[:path], "shevy"))
|
47
|
+
else
|
48
|
+
Pathname.new("shevy")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def install_files
|
53
|
+
make_install_directory
|
54
|
+
copy_in_scss_files
|
55
|
+
end
|
56
|
+
|
57
|
+
def remove_shevy_directory
|
58
|
+
FileUtils.rm_rf("shevy")
|
59
|
+
end
|
60
|
+
|
61
|
+
def make_install_directory
|
62
|
+
FileUtils.mkdir_p(install_path)
|
63
|
+
end
|
64
|
+
|
65
|
+
def copy_in_scss_files
|
66
|
+
FileUtils.cp_r(all_stylesheets, install_path)
|
67
|
+
end
|
68
|
+
|
69
|
+
def all_stylesheets
|
70
|
+
Dir["#{stylesheets_directory}/*"]
|
71
|
+
end
|
72
|
+
|
73
|
+
def stylesheets_directory
|
74
|
+
File.join(top_level_directory, "core")
|
75
|
+
end
|
76
|
+
|
77
|
+
def top_level_directory
|
78
|
+
File.dirname(File.dirname(File.dirname(__FILE__)))
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/lib/shevy/version.rb
CHANGED
data/package.json
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"name": "Shevy",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "A vertical rhythm library",
|
5
|
+
"main": "Gruntfile.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "git@github.com:kyleshevlin/shevy.git"
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"Shevy",
|
15
|
+
"vertical",
|
16
|
+
"rhythm",
|
17
|
+
"typography",
|
18
|
+
"Sass"
|
19
|
+
],
|
20
|
+
"author": "Kyle Shevlin",
|
21
|
+
"license": "ISC",
|
22
|
+
"bugs": {
|
23
|
+
"url": "https://github.com/kyleshevlin/shevy/issues"
|
24
|
+
},
|
25
|
+
"homepage": "https://github.com/kyleshevlin/shevy",
|
26
|
+
"devDependencies": {
|
27
|
+
"grunt": "^0.4.5",
|
28
|
+
"grunt-autoprefixer": "^3.0.0",
|
29
|
+
"grunt-contrib-connect": "^0.10.1",
|
30
|
+
"grunt-contrib-sass": "^0.9.2",
|
31
|
+
"grunt-contrib-watch": "^0.6.1",
|
32
|
+
"load-grunt-tasks": "^3.1.0"
|
33
|
+
}
|
34
|
+
}
|
data/sache.json
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shevy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Shevlin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -48,17 +48,27 @@ extra_rdoc_files: []
|
|
48
48
|
files:
|
49
49
|
- ".gitignore"
|
50
50
|
- Gemfile
|
51
|
+
- Gruntfile.js
|
52
|
+
- LICENSE.md
|
51
53
|
- README.md
|
52
54
|
- Rakefile
|
53
55
|
- bin/console
|
54
56
|
- bin/setup
|
57
|
+
- bower.json
|
58
|
+
- core/_shevy.scss
|
59
|
+
- core/_shevy_functions.scss
|
60
|
+
- core/_shevy_mixins.scss
|
61
|
+
- core/_shevy_variables.scss
|
62
|
+
- demo/css/style.css
|
63
|
+
- demo/dist/style.css
|
64
|
+
- demo/index.html
|
65
|
+
- demo/scss/style.scss
|
55
66
|
- lib/shevy.rb
|
67
|
+
- lib/shevy/generator.rb
|
56
68
|
- lib/shevy/version.rb
|
69
|
+
- package.json
|
70
|
+
- sache.json
|
57
71
|
- shevy.gemspec
|
58
|
-
- vendor/assets/stylesheets/shevy.scss
|
59
|
-
- vendor/assets/stylesheets/shevy/_shevy_functions.scss
|
60
|
-
- vendor/assets/stylesheets/shevy/_shevy_mixins.scss
|
61
|
-
- vendor/assets/stylesheets/shevy/_shevy_variables.scss
|
62
72
|
homepage: https://github.com/kyleshevlin/shevy
|
63
73
|
licenses:
|
64
74
|
- MIT
|
@@ -1,13 +0,0 @@
|
|
1
|
-
//////////////////////////////
|
2
|
-
// Shevy
|
3
|
-
// Version: 1.0.0
|
4
|
-
// Author: Kyle Shevlin
|
5
|
-
// Github: https://www.github.com/kyleshevlin
|
6
|
-
// Repo: https://www.github.com/kyleshevlin/shevy
|
7
|
-
//////////////////////////////
|
8
|
-
|
9
|
-
@import
|
10
|
-
'shevy/shevy_variables',
|
11
|
-
'shevy/shevy_functions',
|
12
|
-
'shevy/shevy_mixins'
|
13
|
-
;
|
@@ -1,39 +0,0 @@
|
|
1
|
-
//////////////////////////////
|
2
|
-
// Shevy Functions
|
3
|
-
//////////////////////////////
|
4
|
-
|
5
|
-
// Get font size from the font-scale
|
6
|
-
@function get-font-scale-value($iterator, $map: $shevy) {
|
7
|
-
@return nth(map-get($map, 'base-font-scale'), $iterator);
|
8
|
-
}
|
9
|
-
|
10
|
-
// Base Unit Multiplier
|
11
|
-
// Creates a 1(base-unit) to use for multiplying
|
12
|
-
@function base-unit-multiplier($unit) {
|
13
|
-
@if $unit == 'px' {
|
14
|
-
@return 1px;
|
15
|
-
} @else if $unit == 'em' {
|
16
|
-
@return 1em;
|
17
|
-
} @else if $unit == 'rem' {
|
18
|
-
@return 1rem;
|
19
|
-
} @else {
|
20
|
-
@warn "Sorry, but that's an unsupported unit of measure.";
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
// Base-spacing
|
25
|
-
// Allows the user to create spacing as multiples or dividends of the $base-spacing variable
|
26
|
-
@function base-spacing($factor: 1, $map: $shevy) {
|
27
|
-
// Merge defaults with provided map,
|
28
|
-
$_current_map: map-merge($shevy-defaults, $map);
|
29
|
-
|
30
|
-
$_base-font-size: map-get($_current_map, 'base-font-size');
|
31
|
-
$_base-line-height: map-get($_current_map, 'base-line-height');
|
32
|
-
$_base-spacing: $_base-font-size * $_base-line-height;
|
33
|
-
|
34
|
-
@return $_base-spacing * $factor;
|
35
|
-
}
|
36
|
-
|
37
|
-
@function bs($factor: 1, $map: $shevy) {
|
38
|
-
@return base-spacing($factor, $map);
|
39
|
-
}
|