pure-sass 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/Guardfile +1 -0
  6. data/README.md +10 -1
  7. data/Rakefile +72 -10
  8. data/app/assets/stylesheets/pure/all.css.scss +7 -0
  9. data/app/assets/stylesheets/pure/base/normalize-context.css.scss +233 -0
  10. data/app/assets/stylesheets/pure/base/{normalize.css.sass → normalize.css.scss} +307 -204
  11. data/app/assets/stylesheets/pure/base.css.scss +2 -0
  12. data/app/assets/stylesheets/pure/buttons/buttons-core.css.scss +27 -0
  13. data/app/assets/stylesheets/pure/buttons/buttons-theme.css.scss +110 -0
  14. data/app/assets/stylesheets/pure/buttons/buttons.css.scss +83 -0
  15. data/app/assets/stylesheets/pure/buttons.css.scss +3 -0
  16. data/app/assets/stylesheets/pure/defaults.css.scss +44 -0
  17. data/app/assets/stylesheets/pure/forms/{forms-core.css.sass → forms-core.css.scss} +91 -74
  18. data/app/assets/stylesheets/pure/forms/forms-r.css.scss +31 -0
  19. data/app/assets/stylesheets/pure/forms/forms-theme.css.scss +362 -0
  20. data/app/assets/stylesheets/pure/forms/forms.css.scss +167 -0
  21. data/app/assets/stylesheets/pure/forms.css.scss +4 -0
  22. data/app/assets/stylesheets/pure/grids/grids-core.css.scss +24 -0
  23. data/app/assets/stylesheets/pure/grids/grids-r.css.scss +54 -0
  24. data/app/assets/stylesheets/pure/grids/grids-units.css.scss +147 -0
  25. data/app/assets/stylesheets/pure/grids.css.scss +3 -0
  26. data/app/assets/stylesheets/pure/lists/lists-theme.css.scss +241 -0
  27. data/app/assets/stylesheets/pure/menus/menus-core.css.scss +111 -0
  28. data/app/assets/stylesheets/pure/menus/menus-paginator.css.scss +31 -0
  29. data/app/assets/stylesheets/pure/menus/menus-r.css.scss +14 -0
  30. data/app/assets/stylesheets/pure/menus/menus.css.scss +78 -0
  31. data/app/assets/stylesheets/pure/menus.css.scss +4 -0
  32. data/app/assets/stylesheets/pure/tables/tables-theme.css.scss +72 -0
  33. data/app/assets/stylesheets/pure/tables/tables.css.scss +82 -0
  34. data/app/assets/stylesheets/pure/tables.css.scss +2 -0
  35. data/lib/pure/sass/default_translation.rb +28 -0
  36. data/lib/pure/sass/translation.rb +24 -0
  37. data/lib/pure/sass/version.rb +1 -1
  38. data/lib/pure/sass.rb +2 -0
  39. data/pure-sass.gemspec +2 -1
  40. data/spec/acceptance/sass_spec.rb +10 -0
  41. data/spec/fixtures/buttons.css.handlebars +110 -0
  42. data/spec/fixtures/form.css.handlebars +362 -0
  43. data/spec/fixtures/list.css.handlebars +241 -0
  44. data/spec/fixtures/table.css.handlebars +72 -0
  45. data/spec/lib/pure/sass/default_translation_spec.rb +18 -0
  46. data/spec/lib/pure/sass/translation_spec.rb +19 -0
  47. data/spec/sass_importer.rb +14 -0
  48. data/spec/spec_helper.rb +2 -1
  49. metadata +78 -28
  50. data/app/assets/stylesheets/pure/all.css.sass +0 -7
  51. data/app/assets/stylesheets/pure/base/normalize-context.css.sass +0 -152
  52. data/app/assets/stylesheets/pure/base.css.sass +0 -2
  53. data/app/assets/stylesheets/pure/buttons/buttons-core.css.sass +0 -23
  54. data/app/assets/stylesheets/pure/buttons/buttons.css.sass +0 -103
  55. data/app/assets/stylesheets/pure/buttons.css.sass +0 -2
  56. data/app/assets/stylesheets/pure/defaults.css.sass +0 -0
  57. data/app/assets/stylesheets/pure/forms/forms-r.css.sass +0 -22
  58. data/app/assets/stylesheets/pure/forms/forms.css.sass +0 -128
  59. data/app/assets/stylesheets/pure/forms.css.sass +0 -3
  60. data/app/assets/stylesheets/pure/grids/grids-core.css.sass +0 -26
  61. data/app/assets/stylesheets/pure/grids/grids-r.css.sass +0 -34
  62. data/app/assets/stylesheets/pure/grids/grids-units.css.sass +0 -93
  63. data/app/assets/stylesheets/pure/grids.css.sass +0 -3
  64. data/app/assets/stylesheets/pure/menus/menus-core.css.sass +0 -99
  65. data/app/assets/stylesheets/pure/menus/menus-paginator.css.sass +0 -24
  66. data/app/assets/stylesheets/pure/menus/menus-r.css.sass +0 -8
  67. data/app/assets/stylesheets/pure/menus/menus.css.sass +0 -65
  68. data/app/assets/stylesheets/pure/menus.css.sass +0 -4
  69. data/app/assets/stylesheets/pure/tables/tables.css.sass +0 -68
  70. data/app/assets/stylesheets/pure/tables.css.sass +0 -1
  71. data/spec/assets_spec.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c37439e1e2d7af2ea0d45f72eae56a6cc398d97f
4
- data.tar.gz: f05428253c29da1a3d29143eaffe7eeef5a992f5
3
+ metadata.gz: 2893dafd8b818ec3a9a53539a6d6e797c289b797
4
+ data.tar.gz: 2ccd5a285af89d8989aeee275cc1b410449d06d3
5
5
  SHA512:
6
- metadata.gz: 1078363aca87826cafb5ab87c830389ab4b0fc1315365d101e96201f6eaa9bcff5b7a02014c84d7f649ac09776a4ce02c40326ed97a7c9ee98ab2c91643f6030
7
- data.tar.gz: 62ca01f38277a7ac34be53ea98d6fb5f16ab6c136ccdd323a0e6d946c2138b0b52d662f078e3d2af3d0d32163d7c8ac888193d4f532d3b70b084334f9467dd25
6
+ metadata.gz: 486c6484123e2a088caf6218e0a343b0c952c9fb9092e1d4892a9ea284bf786cd0cf60124ca71883161cc0803c089d7a1e0d1d0d12abc5a0b1b71683df1ce103
7
+ data.tar.gz: ee435a3b8d122322d8123290c28fca68a344d871f31d7befe39d992499586145af98e53d064a7c4ca3ec5f30272c7ca7d81a5998354a15ba3bbdc95e18f0cb2f
data/.gitignore CHANGED
@@ -2,7 +2,9 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
+ .sass-cache
5
6
  .yardoc
7
+ .sass-cache
6
8
  Gemfile.lock
7
9
  InstalledFiles
8
10
  _yardoc
@@ -15,3 +17,5 @@ spec/reports
15
17
  test/tmp
16
18
  test/version_tmp
17
19
  tmp
20
+
21
+ app/assets/**/*.handlebars
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ pure-sass
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0
data/Guardfile CHANGED
@@ -7,6 +7,7 @@ guard :rspec do
7
7
  watch(%r{^spec/.+_spec\.rb$})
8
8
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
9
9
  watch('spec/spec_helper.rb') { "spec" }
10
+ watch(%r{^app/assets/.+\.scss$}) { "spec/acceptance/sass_spec.rb"}
10
11
  end
11
12
 
12
13
  guard 'sass', :input => 'sass', :output => 'css'
data/README.md CHANGED
@@ -4,6 +4,15 @@ pure-sass is a port of [Yahoo!'s Pure CSS](http://purecss.io/) framework to SASS
4
4
 
5
5
  [![Build Status](https://travis-ci.org/jamesotron/pure-sass.png?branch=master)](https://travis-ci.org/jamesotron/pure-sass)
6
6
 
7
+ ## Plea
8
+
9
+ To be honest, I don't really know that much about CSS, I just wanted this Gem to exist so that I
10
+ could use it on a project. I will gladly accept almost any contribution to help with maintaining
11
+ this Gem and will give commit rights to anyone who asks for it.
12
+
13
+ In the long run, I expect that maintainership will be handed to someone else, but I'm happy to
14
+ incubate it here for now.
15
+
7
16
  ## Usage
8
17
 
9
18
  Add pure-sass to your applications `Gemfile`
@@ -21,7 +30,7 @@ Then in your `app/assets/stylesheets/application.css` you can use
21
30
  or in your SASS or SCSS files you can use
22
31
 
23
32
  ```sass
24
- @include 'pure/all'
33
+ @import 'pure/all'
25
34
  ```
26
35
 
27
36
  If you don't want all of Pure then you can manually include
data/Rakefile CHANGED
@@ -1,13 +1,70 @@
1
1
  require "bundler/gem_tasks"
2
2
  require 'rspec/core/rake_task'
3
+ require 'nokogiri'
4
+ require 'pure/sass'
5
+
3
6
  RSpec::Core::RakeTask.new(:spec)
4
7
 
8
+ namespace :website do
9
+ desc "Scrape the pure website for tempates"
10
+ task :scrape do
11
+ dir = Dir.mktmpdir
12
+ sh("wget -O #{dir}/index.html http://yui.github.io/skinbuilder/?mode=pure")
13
+ @outfile = "#{dir}/index.html"
14
+ end
15
+
16
+ def template_files
17
+ {
18
+ form: "forms",
19
+ buttons: "buttons",
20
+ table: "tables",
21
+ list: "lists"
22
+ }
23
+ end
24
+
25
+ template_files.each do |template_key, template_value|
26
+ file "app/assets/stylesheets/pure/#{template_value}/#{template_value}-theme.css.handlebars" => :scrape do |task|
27
+ sh("mkdir -p app/assets/stylesheets/pure/#{template_value}")
28
+ File.open(task.name, 'w') do |file|
29
+ file.write(extract_template(template_key))
30
+ end
31
+ end
32
+ end
33
+
34
+ rule ".scss" => ".handlebars" do |task|
35
+ Pure::Sass::Translation.new(task.source).render(task.name)
36
+ end
37
+
38
+ def generate_dependencies(file_extension)
39
+ template_files.values.map { |f| "app/assets/stylesheets/pure/#{f}/#{f}-theme.css.#{file_extension}" }
40
+ end
41
+
42
+ def extract_template(name)
43
+ doc = Nokogiri::HTML(File.read(@outfile))
44
+ doc.css("##{name}-template").first.content
45
+ end
46
+
47
+ desc "Templates"
48
+ task :templates => generate_dependencies("handlebars")
49
+
50
+ desc "SCSS"
51
+ task :scss => generate_dependencies("scss")
52
+
53
+ desc "Clean handlebars and index file(s)"
54
+ task :clean do
55
+ generate_dependencies("handlebars").each do |file|
56
+ sh("rm #{file}")
57
+ end
58
+ sh("rm #{@outfile}")
59
+ end
60
+ end
61
+
5
62
  namespace :upstream do
6
63
 
7
64
  def generate_sass_dependencies
8
65
  find_upstream_css_files.map do |source|
9
66
  mod, base = source.scan(/purecss\/src\/([a-z_]+)\/.+\/([a-z_-]+).css\Z/)[0]
10
- "app/assets/stylesheets/pure/#{mod}/#{base}.css.sass"
67
+ "app/assets/stylesheets/pure/#{mod}/#{base}.css.scss"
11
68
  end
12
69
  end
13
70
 
@@ -16,7 +73,7 @@ namespace :upstream do
16
73
  end
17
74
 
18
75
  def generate_top_level_dependencies
19
- sass_files.map { |p| "app/assets/stylesheets/pure/#{p}.css.sass" }
76
+ sass_files.map { |p| "app/assets/stylesheets/pure/#{p}.css.scss" }
20
77
  end
21
78
 
22
79
  def find_upstream_css_files
@@ -24,7 +81,9 @@ namespace :upstream do
24
81
  end
25
82
 
26
83
  desc "Import CSS files from upstream and convert them to SASS"
27
- task :import => generate_sass_dependencies + generate_top_level_dependencies
84
+ task :import => generate_sass_dependencies
85
+
86
+ task :combine => generate_top_level_dependencies
28
87
 
29
88
  desc "Update upstream CSS files"
30
89
  task :update do
@@ -33,24 +92,27 @@ namespace :upstream do
33
92
 
34
93
  generate_top_level_dependencies.each do |path|
35
94
  file path do
36
- if File.basename(path) == 'all.css.sass'
37
- File.write(path, (sass_files - ['all']).map { |f| "@import \"#{f}\"\n" }.join)
95
+ if File.basename(path) == 'all.css.scss'
96
+ File.write(path, (sass_files - ['all']).map { |f| "@import \"#{f}\";\n" }.join)
38
97
  else
39
- dir_path = path.gsub(/\.css\.sass\Z/, '')
98
+ dir_path = path.gsub(/\.css\.scss\Z/, '')
40
99
  mod = File.basename(dir_path)
41
100
  File.open(path, "w") do |file|
42
- Dir["#{dir_path}/*.sass"].each do |sass|
43
- file.puts "@import \"#{mod}/#{File.basename(sass).gsub(/\.css\.sass\Z/, '')}\""
101
+ Dir["#{dir_path}/*.scss"].each do |sass|
102
+ file.puts "@import \"#{mod}/#{File.basename(sass).gsub(/\.css\.scss\Z/, '')}\";"
44
103
  end
45
104
  end
46
105
  end
47
106
  end
48
107
  end
49
108
 
50
- rule(/.*\.css\.sass\Z/ => [proc { |t| t.sub(/\A.*\/([a-z_-]+)\/([a-z_-]+)\.css\.sass\Z/, 'vendor/upstream/purecss/src/\1/css/\2.css') }]) do |t|
109
+ rule(/.*\.css\.scss\Z/ => [proc { |t| t.sub(/\A.*\/([a-z_-]+)\/([a-z_-]+)\.css\.scss\Z/, 'vendor/upstream/purecss/src/\1/css/\2.css') }]) do |t|
51
110
  sh "mkdir -p #{File.dirname(t.name).inspect}"
52
- sh "sass-convert -C -F css -T sass #{t.source.inspect} #{t.name.inspect}"
111
+ sh "cp #{t.source.inspect} #{t.name.inspect}"
53
112
  end
54
113
  end
55
114
 
115
+ desc "Build the combined output from :website and :upstream"
116
+ task :generate => ["upstream:import", "website:scss", "upstream:combine", "website:clean"]
117
+
56
118
  task :default => [ :spec ]
@@ -0,0 +1,7 @@
1
+ @import "defaults";
2
+ @import "base";
3
+ @import "buttons";
4
+ @import "forms";
5
+ @import "grids";
6
+ @import "menus";
7
+ @import "tables";
@@ -0,0 +1,233 @@
1
+ /* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */
2
+ .pure article,
3
+ .pure aside,
4
+ .pure details,
5
+ .pure figcaption,
6
+ .pure figure,
7
+ .pure footer,
8
+ .pure header,
9
+ .pure hgroup,
10
+ .pure main,
11
+ .pure nav,
12
+ .pure section,
13
+ .pure summary {
14
+ display: block;
15
+ }
16
+ .pure audio,
17
+ .pure canvas,
18
+ .pure video {
19
+ display: inline-block;
20
+ }
21
+ .pure audio:not([controls]) {
22
+ display: none;
23
+ height: 0;
24
+ }
25
+ .pure [hidden] {
26
+ display: none;
27
+ }
28
+ .pure {
29
+ font-size: 100%;
30
+ -ms-text-size-adjust: 100%;
31
+ -webkit-text-size-adjust: 100%;
32
+ }
33
+ .pure,
34
+ .pure button,
35
+ .pure input,
36
+ .pure select,
37
+ .pure textarea {
38
+ font-family: sans-serif;
39
+ }
40
+ .pure body {
41
+ margin: 0;
42
+ }
43
+ .pure a:focus {
44
+ outline: thin dotted;
45
+ }
46
+ .pure a:active,
47
+ .pure a:hover {
48
+ outline: 0;
49
+ }
50
+ .pure h1 {
51
+ font-size: 2em;
52
+ margin: 0.67em 0;
53
+ }
54
+ .pure h2 {
55
+ font-size: 1.5em;
56
+ margin: 0.83em 0;
57
+ }
58
+ .pure h3 {
59
+ font-size: 1.17em;
60
+ margin: 1em 0;
61
+ }
62
+ .pure h4 {
63
+ font-size: 1em;
64
+ margin: 1.33em 0;
65
+ }
66
+ .pure h5 {
67
+ font-size: 0.83em;
68
+ margin: 1.67em 0;
69
+ }
70
+ .pure h6 {
71
+ font-size: 0.67em;
72
+ margin: 2.33em 0;
73
+ }
74
+ .pure abbr[title] {
75
+ border-bottom: 1px dotted;
76
+ }
77
+ .pure b,
78
+ .pure strong {
79
+ font-weight: bold;
80
+ }
81
+ .pure blockquote {
82
+ margin: 1em 40px;
83
+ }
84
+ .pure dfn {
85
+ font-style: italic;
86
+ }
87
+ .pure hr {
88
+ -moz-box-sizing: content-box;
89
+ box-sizing: content-box;
90
+ height: 0;
91
+ }
92
+ .pure mark {
93
+ background: #ff0;
94
+ color: #000;
95
+ }
96
+ .pure p,
97
+ .pure pre {
98
+ margin: 1em 0;
99
+ }
100
+ .pure code,
101
+ .pure kbd,
102
+ .pure pre,
103
+ .pure samp {
104
+ font-family: monospace , serif;
105
+ _font-family: 'courier new' , monospace;
106
+ font-size: 1em;
107
+ }
108
+ .pure pre {
109
+ white-space: pre;
110
+ white-space: pre-wrap;
111
+ word-wrap: break-word;
112
+ }
113
+ .pure q {
114
+ quotes: none;
115
+ }
116
+ .pure q:before,
117
+ .pure q:after {
118
+ content: '';
119
+ content: none;
120
+ }
121
+ .pure small {
122
+ font-size: 80%;
123
+ }
124
+ .pure sub,
125
+ .pure sup {
126
+ font-size: 75%;
127
+ line-height: 0;
128
+ position: relative;
129
+ vertical-align: baseline;
130
+ }
131
+ .pure sup {
132
+ top: -0.5em;
133
+ }
134
+ .pure sub {
135
+ bottom: -0.25em;
136
+ }
137
+ .pure dl,
138
+ .pure menu,
139
+ .pure ol,
140
+ .pure ul {
141
+ margin: 1em 0;
142
+ }
143
+ .pure dd {
144
+ margin: 0 0 0 40px;
145
+ }
146
+ .pure menu,
147
+ .pure ol,
148
+ .pure ul {
149
+ padding: 0 0 0 40px;
150
+ }
151
+ .pure nav ul,
152
+ .pure nav ol {
153
+ list-style: none;
154
+ list-style-image: none;
155
+ }
156
+ .pure img {
157
+ border: 0;
158
+ -ms-interpolation-mode: bicubic;
159
+ }
160
+ .pure svg:not(:root) {
161
+ overflow: hidden;
162
+ }
163
+ .pure figure {
164
+ margin: 0;
165
+ }
166
+ .pure form {
167
+ margin: 0;
168
+ }
169
+ .pure fieldset {
170
+ border: 1px solid #c0c0c0;
171
+ margin: 0 2px;
172
+ padding: 0.35em 0.625em 0.75em;
173
+ }
174
+ .pure legend {
175
+ border: 0;
176
+ padding: 0;
177
+ white-space: normal;
178
+ }
179
+ .pure button,
180
+ .pure input,
181
+ .pure select,
182
+ .pure textarea {
183
+ font-size: 100%;
184
+ margin: 0;
185
+ vertical-align: baseline;
186
+ }
187
+ .pure button,
188
+ .pure input {
189
+ line-height: normal;
190
+ }
191
+ .pure button,
192
+ .pure select {
193
+ text-transform: none;
194
+ }
195
+ .pure button,
196
+ .pure input[type="button"],
197
+ .pure input[type="reset"],
198
+ .pure input[type="submit"] {
199
+ -webkit-appearance: button;
200
+ cursor: pointer;
201
+ }
202
+ .pure button[disabled],
203
+ .pure input[disabled] {
204
+ cursor: default;
205
+ }
206
+ .pure input[type="checkbox"],
207
+ .pure input[type="radio"] {
208
+ box-sizing: border-box;
209
+ padding: 0;
210
+ }
211
+ .pure input[type="search"] {
212
+ -webkit-appearance: textfield;
213
+ -moz-box-sizing: content-box;
214
+ -webkit-box-sizing: content-box;
215
+ box-sizing: content-box;
216
+ }
217
+ .pure input[type="search"]::-webkit-search-cancel-button,
218
+ .pure input[type="search"]::-webkit-search-decoration {
219
+ -webkit-appearance: none;
220
+ }
221
+ .pure button::-moz-focus-inner,
222
+ .pure input::-moz-focus-inner {
223
+ border: 0;
224
+ padding: 0;
225
+ }
226
+ .pure textarea {
227
+ overflow: auto;
228
+ vertical-align: top;
229
+ }
230
+ .pure table {
231
+ border-collapse: collapse;
232
+ border-spacing: 0;
233
+ }