style-tiles 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- data.tar.gz: 913ea0bd1a363d785346f8260f8dab8ed3f00fab
4
- metadata.gz: 826a93059f8df6ed30c74e8d6c366f463a5722af
5
2
  SHA512:
6
- data.tar.gz: 4458f06e82c44e7053f4b4efc2b5c63c3980597f4ec25c7da19b61f0dc8809c1839137a7277da02ac663ae515ee72cccd5fc90602e800d4fe70fb9b1fd9f576c
7
- metadata.gz: e992f0a474a2d7adc204cb2b7d5a27b1a93696e7a41b3c98ae3769fe9424049abc2fdc212b520dedd20450e834f232e21bce3cf6f1f5e55c1401c3cc96f03c4f
3
+ metadata.gz: 3885b3ba701506de4c2df6abe3cda362d9f85051edc2436042b57b3154e9d956900fb387315d05eb6a49f1ba32d717b3bb8824b24407479ffa348d8df6b3daf7
4
+ data.tar.gz: 14c2feed11719c065c955fa7a75cf18ae6aaf2ad89b77dd5d6cd0d7d80b23033b3406585b9af579742ab72bbe282a213351929a79bb8960eaafb0c1e316e5589
5
+ SHA1:
6
+ metadata.gz: 339df9ba2959c3c3f56820892903296cef2be6e6
7
+ data.tar.gz: f45e001e7cbd78ea50490560f0d68ea0bfe23785
@@ -0,0 +1,6 @@
1
+ ## Ruby gem ChangeLog
2
+ * **0.1** First pass at creating compass extension and ruby gem.
3
+ * **0.1.1** Created templates for building scaffolding in a compass project.
4
+ * **0.1.2** Added functionality to control the index page: content and list.
5
+ * **0.1.3** Updated font face mixin, added outline offset.
6
+ * **0.1.4** Added MIT GPL-3 Licenses — thanks to Benjamin Fleischer (https://github.com/bf4) for the prompting
@@ -0,0 +1,311 @@
1
+ # Compass Style Tiles
2
+
3
+ #### Create HTML and CSS Style Tiles with Sass & Compass
4
+ _This is the development repo for the compass extension and rubygem: [style-tiles](https://rubygems.org/gems/style-tiles)._
5
+ **This is currently under active development**
6
+ Feedback is very welcome!
7
+
8
+ ### *New* Style Tiles is now a Compass extension!
9
+ Style Tiles has changed from a sass project to a compass extension. This makes it much easier to get started and to reuse. You can build a starter project using one line and start working on creating style tiles right away. See the **Installation** notes for details on getting started.
10
+
11
+ ## Background
12
+ I loved Samantha Warren's idea of [style tiles](http://styletil.es/). It seemed like the best answer to moving away from time-draining pixel perfect comps. However I'm designing in the browser more and more and I didn't want to go back into pixel based AdobeLand — Photoshop or Fireworks to create Style Tiles. Especially now that
13
+ I am doing Responsive Web Design, I wanted to be designing and thinking in CSS and HTML. I thought this would be a perfect project for Sass and Compass.
14
+
15
+ ## Design Philosophy
16
+ Style Tiles should be primarily easy to share (i.e. easy for you to send to clients
17
+ and easy for them to view it). You should be able to send your designs as easily as a static mockup image. Be it an email attachment or a link to _any_ webserver where you uploaded your designs.
18
+
19
+ #### Build for rapid iteration
20
+ + **Highly customizable** use sass variables wherever much as possible
21
+ + **Reuse the HTML** No real need to edit the HTML
22
+ + **Body copy** is also controlled by sass variables
23
+ + **1 to 1 mapping** single file to control each iteration
24
+ + **Easily iterated** simply duplicate the `.scss` files
25
+
26
+ #### Use only HTML and CSS where possible
27
+ + **Viewable Everywhere!** No server-side technologies
28
+ + **Modern browser support only** (this ain't production code)
29
+ + **Simple & clean HTML5**
30
+ + **Use CSS3 selectors and pseudo-classes** (avoid classes or ids)
31
+ + **No dependancies on other css frameworks** (Bootstrap or Foundation etc.)
32
+ + **Embed images and fonts in CSS** (you don't need to zip up a lot of files and folders)
33
+ + **Embed Styles in HTML** One file per iteration to send with no nested folders
34
+
35
+ Style Tiles should be deployable as simple HTML and CSS. Style Tiles should be able to view from any folder on a desktop or any web server. To keep the CSS simple — Style Tiles *need* to be viewed in modern browsers: Firefox and Webkit based browsers. Viewable anywhere! I am using CSS rather than some server solution.
36
+
37
+ ### Project History
38
+ The idea for creating HTML and CSS style tiles had been brewing in my head for awhile. I started the initial development on the bus ride to Design 4 Drupal 2012. I presented the idea in a BoF on Compass and got some positive feedback and interest.
39
+
40
+ The first iteration was a straight-forward Sass-*ified* project \([archived here](https://github.com/alienresident/style-tiles/tree/archive)\). I was able to get the images and the fonts to using compass functions. However, I knew I need a custom function in the `config.rb` to copy the current css and add it to a `<style>` tag in the `<head>` of the HTML document. Thankfully, [Zellio](https://github.com/zellio) contributed his Ruby knowledge and created that exact [custom function](https://github.com/alienresident/style-tiles/blob/dryad/config.rb).
41
+
42
+ I paused development for awhile to work on my [Pattern Primer](https://github.com/alienresident/compass-pattern-primer). That too started as a sass project and eventually it made sense to make it into a compass extension. Thanks to [Sam Richard](https://github.com/snugug)'s [Compass Extension Template](https://github.com/Team-Sass/Compass-Extension-Template) I was easily able to create my Compass Pattern Primer extension. Returning to Design 4 Drupal in 2013 on the bus, I thought it was time to convert Style Tiles to a compass extension and here we are.
43
+
44
+ ## Installation
45
+ Compass Pattern Primer is a compass extension bundled as a Ruby gem.
46
+
47
+ ```bash
48
+ gem install compass-pattern-primer
49
+ ```
50
+ You'll need to install [Sass](http://sass-lang.com/) and [Compass](http://compass-style.org/) Ruby Gems too. Documentation for installing and using these gems is pretty extensive.
51
+
52
+ ## How to Use it
53
+ There are a number of ways you can get started with Style Tiles.
54
+
55
+ #### Recommended: Create a new Compass project using Style Tiles scaffolding
56
+ ```bash
57
+ compass create <MyProject> -r style-tiles -u style-tiles
58
+ ```
59
+ ```bash
60
+ cd <MyProject>
61
+ compass complie
62
+ ```
63
+ * **Note:** replace `<MyProject>` with name of your project (without the `<` `>`)*
64
+ This will generate four stylesheets and the paste the styles into four corresponding html files (index, v1, v2, and v3).
65
+
66
+ #### Other ways to add Style Tiles to your compass project
67
+
68
+ ```bash
69
+ compass create <MyProject> -r style-tiles
70
+ ```
71
+
72
+ This creates a new Compass project using the compass standard scaffolding and adds `require 'style-tiles'` to the `config.rb`. However without the custom config.rb and html file you lose the benefit of adding your styles to the HTML and you don't have a starter scaffolding with variables examples.
73
+
74
+ #### Add Style Tiles to an existing project by adding the following to config.rb
75
+
76
+ ```ruby
77
+ require 'style-tiles'
78
+ ```
79
+ Then import the Compass Pattern Primer partial by adding at the top of your working file
80
+
81
+ ```scss
82
+ @import "style-tiles";
83
+ ```
84
+ **Note:** *You'll need to restart* `compass watch` *if it's running*. And again without the custom config.rb and html file you lose the benefit of adding your styles to the HTML and you don't have a starter scaffolding with variables examples.
85
+
86
+ ## How It Works
87
+
88
+ There's an index page that links to the 3 version pages. Each page has it's own
89
+ stylesheet. When you `compile compass` the CSS files are generated from the `.scss` files in the `sass` folder. The corresponding HTML files are generated from `template.html` and the CSS is added to the `<head>` of the HTML files.
90
+
91
+ ### Deploying the Styles Tiles
92
+ The HTML files are self-contained. All the images, and fonts are embedded in the style and the style is embedded in the HTML. However if you don't want to inline your images. Set `$inline-images` to `false` in your `partials/variations/_v*.scss` and include the images folder. The same goes for fonts, set `$inline-fonts` to `false`.
93
+
94
+ ### Adding more Versions
95
+ More pages can be easily added by duplicating these files
96
+
97
+ + `sass/v3.scss` to `sass/v4.scss`
98
+ + `sass/paritals/variations/\_v3.scss` to `sass/paritals/variations/\_v4.scss`
99
+
100
+ Then you'll need to make some easy edits
101
+
102
+ + change `@import "partials/variations/\_v3";` to `@import
103
+ "partials/variations/\_v4";` in `sass/v4.scss`
104
+ + edit the variables you want to change in `sass/paritals/variations/\_v4.scss`
105
+
106
+ ### Displaying updated versions on the homepage
107
+ Update what versions are displayed by updating the $show-versions variables.
108
+ `$show-versions: 1, 2, 3;`
109
+ to
110
+ `$show-versions: 1, 2, 3, 4;`
111
+ or
112
+ `$show-versions: 1, 3, 4;`
113
+ etc.
114
+
115
+ ### What variables are available? ###
116
+
117
+ The full list of variables that are available is in the compass gem's stylesheets folder:
118
+ [style-tiles/core/\_variables.scss](https://github.com/alienresident/style-tiles/blob/master/stylesheets/style-tiles/core/_variables.scss)
119
+
120
+ ### Code Examples
121
+
122
+ #### How the copy variables are transformed into CSS
123
+
124
+ Here's an example of how the `content-before-after` [mixin](https://github.com/alienresident/style-tiles/blob/master/stylesheets/style-tiles/core/_mixins.scss) creates the pseudo
125
+ selector and adds whats in the variables in to the content attribute.
126
+
127
+ ##### HTML
128
+
129
+ Source: _v1.html_
130
+
131
+ ```html
132
+ <hgroup>
133
+ <h1>Project Name: </h1>
134
+ <h2>Versions: </h2>
135
+ </hgroup>
136
+ ...
137
+ <footer>
138
+ </footer>
139
+ ```
140
+
141
+ #### Sass Variables
142
+
143
+ Source: _sass/partials/variations/\_v1.scss_
144
+
145
+ ```scss
146
+ $project-name: "Sassy Style Tiles";
147
+ $footer-text: '\2752\20 Designed by Grey Boxes \2751'; // ❒ Designed by Grey Boxes ❑
148
+ ```
149
+
150
+ ##### Sass Structure partial
151
+
152
+ Source: _sass/partials/core/\_structure.scss_
153
+
154
+ ```scss
155
+ section:nth-of-type(1) header hgroup {
156
+ ...
157
+ h1 {
158
+ ...
159
+ @include content-before-after($project-name, false, true);
160
+ }
161
+ }
162
+ footer {
163
+ ...
164
+ @include content-before-after($footer-text, false, true);
165
+ }
166
+ ```
167
+
168
+ ##### Sass Mixin partial
169
+
170
+ Source: _sass/partials/core/\_mixins.scss_
171
+
172
+ ```scss
173
+ @mixin content-before-after($content, $before: default, $after:false ) {
174
+ @if $before { &:before { content: $content; } }
175
+ @if $after { &:after { content: $content; } }
176
+ }
177
+ ```
178
+
179
+ ##### Generated CSS
180
+
181
+ Source: _css/v1.css_
182
+
183
+ ```css
184
+ section:nth-of-type(1) header hgroup h1:after {
185
+ content: "Sassy Style Tiles";
186
+ }
187
+ ...
188
+ footer:after {
189
+ content: "\2752\20 Designed by Grey Boxes \2751";
190
+ }
191
+ ```
192
+
193
+ #### How the list of textures is transformed into the CSS
194
+
195
+ The `texture-boxes` mixin takes an array (comma separated list) of image file
196
+ names that are in the `images/textures` folder. It uses an
197
+ [@each sass control directive](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#each-directive)
198
+ to generate the CSS. It then uses an
199
+ [@if sass control directive](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#id10)
200
+ to see if you set the images to be inlined (base 64 encoded) into the CSS.
201
+
202
+ ##### HTML
203
+
204
+ Source: _template.html_
205
+
206
+ ```html
207
+ <aside>
208
+ <h3>Textures</h3>
209
+ <figure>
210
+ </figure>
211
+ <figure>
212
+ </figure>
213
+ <figure>
214
+ </figure>
215
+ <figcaption></figcaption>
216
+ </aside>
217
+ ```
218
+
219
+ #### Sass Variables
220
+
221
+ Source: _sass/partials/variations/\_v1.scss_
222
+
223
+ ```scss
224
+ $textures: "cotton-shirt.png", "denim.jpg";
225
+ $inline-images: true; // can be set to false
226
+ ```
227
+
228
+ ##### Sass Structure partial
229
+
230
+ Source: _sass/partials/core/\_structure.scss_
231
+
232
+ ```scss
233
+ aside {
234
+ ...
235
+ &:nth-of-type(2) figure {
236
+ ...
237
+ @include texture-boxes($textures, $inline-images);
238
+ }
239
+ }
240
+ ```
241
+
242
+ ##### Sass Mixin partial
243
+
244
+ Source: _sass/partials/core/\_mixins.scss_
245
+
246
+ ```scss
247
+ @mixin texture-boxes($textures, $inline-images: false) {
248
+ $i : 1;
249
+ @each $texture in $textures {
250
+ &:nth-of-type(#{$i}) {
251
+ border: $figure-border;
252
+ @if $inline-images { @include background-image(inline-image("textures/#{$texture}")); }
253
+ @else { background-image: image-url("textures/#{$texture}"); }
254
+ }
255
+ $i: $i + 1;
256
+ }
257
+ }
258
+ ```
259
+ ##### Generated CSS
260
+
261
+ Source: _css/v1.css_
262
+
263
+ ```css
264
+ /// When inline image is set to false
265
+ aside:nth-of-type(2) figure:nth-of-type(1) {
266
+ border: 0.063em #888888 solid;
267
+ background-image: url('../images/textures/cotton-shirt.png?1346169991');
268
+ }
269
+ aside:nth-of-type(2) figure:nth-of-type(2) {
270
+ border: 0.063em #888888 solid;
271
+ background-image: url('../images/textures/denim.jpg?1345644552');
272
+ }
273
+
274
+ /// When inline image is set to true
275
+ aside:nth-of-type(2) figure:nth-of-type(1) {
276
+ border: 0.063em #888888 solid;
277
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAHg
278
+ CAMAAABKCk6nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2FpVFh0WE1MO
279
+ mNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cm
280
+ VTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wd6c
281
+ mRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4g.....');
282
+ }
283
+ aside:nth-of-type(2) figure:nth-of-type(2) {
284
+ border: 0.063em #888888 solid;
285
+ background-image: url('data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAA
286
+ sABFEdWNreQABAAQAAAAZAAD/4QNvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNr
287
+ ZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhI
288
+ HhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA
289
+ 2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6 MzI6MDAgICAgICAgICI+IDxy.....');
290
+ }
291
+ ```
292
+
293
+ ## Planned Features
294
+
295
+ + Custom font support
296
+
297
+ Currently, the examples utilizes a few open source fonts (that are available at
298
+ Google Fonts). I have added the option to inline the fonts but they will
299
+ significantly increase the size of the css (rarely a good solution for production).
300
+
301
+ If people are interested I may expand to incorporating some other font services.
302
+
303
+ ~~+ Way to control the what links are available on the index page.~~
304
+
305
+ ~~The idea is that you may want to control the visibility of the links on the
306
+ index page. For example, on a second round of iteration you may not want the
307
+ link to version 2 (if the the clients rejected it) to be still visible. This will be forthcoming very soon.~~
308
+
309
+ ##### Requests? Feedback?
310
+ Contact [me](mailto:mark@alienresident.net) or simply file an [issue](https://github.com/alienresident/style-tiles/issues/new)!
311
+
@@ -17,8 +17,8 @@ Compass::Frameworks.register('style-tiles', :path => extension_path)
17
17
  # a prerelease version
18
18
  # Date is in the form of YYYY-MM-DD
19
19
  module Style_Tiles
20
- VERSION = "0.1.3"
21
- DATE = "2013-07-02"
20
+ VERSION = "0.1.4"
21
+ DATE = "2013-08-07"
22
22
  end
23
23
 
24
24
  # This is where any custom SassScript should be placed. The functions will be
@@ -91,10 +91,11 @@
91
91
  @if $padding { padding: 0; }
92
92
  @if $border { border: none; }
93
93
  }
94
- @mixin bold-italic-uppercase($bold :default, $italic: false, $uppercase: false) {
95
- @if $bold { font-weight: bold; }
96
- @if $italic { font-variant: italic; }
94
+ @mixin bold-italic-uppercase-variant($bold :default, $italic: false, $uppercase: false, $variant: false) {
95
+ @if $bold { font-weight: bold; } @else { font-weight: normal; }
96
+ @if $italic { font-style: italic; }
97
97
  @if $uppercase { text-transform: uppercase; }
98
+ @if $variant { font-variant: small-caps; }
98
99
  }
99
100
 
100
101
  @mixin color-boxes($colors) {
@@ -178,14 +179,14 @@
178
179
  h1 {
179
180
  margin: $standard-spacing 0;
180
181
  @include st-text-shadow($heading-h1-text-shadow);
181
- @include bold-italic-uppercase($heading-h1-font-style);
182
+ @include bold-italic-uppercase-variant($heading-h1-font-style);
182
183
  @if $heading-h1-font-size { font-size:$heading-h1-font-size; }
183
184
  @include web-font-family($heading-h1-font-name);
184
185
  color: $heading-h1-font-color;
185
186
  }
186
187
  h2 {
187
188
  @include st-text-shadow($heading-h2-text-shadow);
188
- @include bold-italic-uppercase($heading-h2-font-style);
189
+ @include bold-italic-uppercase-variant($heading-h2-font-style);
189
190
  @if $heading-h2-font-size { font-size:$heading-h2-font-size; }
190
191
  @include web-font-family($heading-h2-font-name);
191
192
  color: $heading-h2-font-color;
@@ -68,14 +68,14 @@ section:nth-of-type(2) {
68
68
  h1 {
69
69
  margin: $standard-spacing 0;
70
70
  @include st-text-shadow($heading-h1-text-shadow);
71
- @include bold-italic-uppercase($heading-h1-font-style);
71
+ @include bold-italic-uppercase-variant($heading-h1-font-style);
72
72
  @if $heading-h1-font-size { font-size:$heading-h1-font-size; }
73
73
  @include web-font-family($heading-h1-font-name);
74
74
  color: $heading-h1-font-color;
75
75
  }
76
76
  h2 {
77
77
  @include st-text-shadow($heading-h2-text-shadow);
78
- @include bold-italic-uppercase($heading-h2-font-style);
78
+ @include bold-italic-uppercase-variant($heading-h2-font-style);
79
79
  @if $heading-h2-font-size { font-size:$heading-h2-font-size; }
80
80
  @include web-font-family($heading-h2-font-name);
81
81
  color: $heading-h2-font-color;
@@ -30,7 +30,7 @@ file 'images/textures/scratched-metal.png', :like => :image, :to => 'textures/sc
30
30
  file 'images/textures/scratched-metal2.png', :like => :image, :to => 'textures/scratched-metal2.png'
31
31
 
32
32
  # Font Import
33
- # Note: Using :font put the files in stylesheets/fonts despite setting fonts_dir
33
+ # Note: Using :font puts the files in stylesheets/fonts despite setting fonts_dir in config.rb
34
34
  file "fonts/DroidSerif/DroidSerif-Bold-webfont.eot", :like => :file, :to => "fonts/DroidSerif/DroidSerif-Bold-webfont.eot"
35
35
  file "fonts/DroidSerif/DroidSerif-Bold-webfont.svg", :like => :file, :to => "fonts/DroidSerif/DroidSerif-Bold-webfont.svg"
36
36
  file "fonts/DroidSerif/DroidSerif-Bold-webfont.ttf", :like => :file, :to => "fonts/DroidSerif/DroidSerif-Bold-webfont.ttf"
@@ -70,15 +70,15 @@ file 'html/template.html', :like => :html, :to => "template.html"
70
70
 
71
71
  # Compass Extension Help
72
72
  help %Q{
73
- For documentation for Style Tiles compass extension / gem see: https://github.com/alienresident/style-tiles
73
+ For documentation for Style Tiles compass extension / gem see: https://github.com/alienresident/style-tiles
74
74
  }
75
75
 
76
76
  # Compass Extension Welcome Message
77
77
  # Users will see this when they create a new project using this template.
78
78
  welcome_message %Q{
79
- Welcome to Style Tiles.
80
- Congratulations! You just have built the basic scaffolding for getting started.
81
- To get started 'cd' into your project and run 'compass compile'.
82
- Documentation is on Github: https://github.com/alienresident/style-tiles
83
- Contact: mark@alienresident.net or use the Style Tiles issue queue on Github.
79
+ Welcome to Style Tiles.
80
+ Congratulations! You just have built the basic scaffolding for getting started.
81
+ To get started 'cd' into your project and run 'compass compile'.
82
+ Documentation is on Github: https://github.com/alienresident/style-tiles
83
+ Contact: mark@alienresident.net or use the Style Tiles issue queue on Github.
84
84
  }
@@ -8,13 +8,4 @@
8
8
  @import "partials/variations/_index";
9
9
 
10
10
  // import the Style Tiles css structure
11
- @import "style-tiles/core/_structure";
12
-
13
-
14
-
15
- //section:nth-of-type(2) {
16
- // display: none;
17
- //}
18
- //section:nth-of-type(3) {
19
- // display: block;
20
- //}
11
+ @import "style-tiles/core/_structure";
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: style-tiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Reilly
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2013-07-02 00:00:00 Z
12
+ date: 2013-08-07 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass
@@ -41,6 +41,8 @@ extensions: []
41
41
  extra_rdoc_files: []
42
42
 
43
43
  files:
44
+ - README.md
45
+ - CHANGELOG.md
44
46
  - lib/style-tiles.rb
45
47
  - stylesheets/style-tiles/core/_content.scss
46
48
  - stylesheets/style-tiles/core/_mixins.scss
@@ -98,8 +100,9 @@ files:
98
100
  - templates/project/sass/v2.scss
99
101
  - templates/project/sass/v3.scss
100
102
  homepage: http://alienresident.net
101
- licenses: []
102
-
103
+ licenses:
104
+ - MIT
105
+ - GPL-3
103
106
  metadata: {}
104
107
 
105
108
  post_install_message: