html5-boilerplate 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data/README.md +81 -0
  2. data/lib/html5-boilerplate.rb +1 -0
  3. data/stylesheets/_html5-boilerplate.scss +13 -0
  4. data/stylesheets/html5-boilerplate/_base.scss +144 -0
  5. data/stylesheets/html5-boilerplate/_fonts.scss +38 -0
  6. data/stylesheets/html5-boilerplate/_handheld.scss +10 -0
  7. data/stylesheets/html5-boilerplate/_helpers.scss +48 -0
  8. data/stylesheets/html5-boilerplate/_media.scss +63 -0
  9. data/stylesheets/html5-boilerplate/_reset.scss +64 -0
  10. data/templates/project/404.html +19 -0
  11. data/templates/project/_flashes.html.haml +5 -0
  12. data/templates/project/_footer.html.haml +2 -0
  13. data/templates/project/_head.html.haml +33 -0
  14. data/templates/project/_header.html.haml +1 -0
  15. data/templates/project/_javascripts.html.haml +35 -0
  16. data/templates/project/_stylesheets.html.haml +6 -0
  17. data/templates/project/application.html.haml +21 -0
  18. data/templates/project/crossdomain.xml +14 -0
  19. data/templates/project/handheld.scss +7 -0
  20. data/templates/project/htaccess.conf +186 -0
  21. data/templates/project/html5/_base.scss +36 -0
  22. data/templates/project/html5/_defaults.scss +21 -0
  23. data/templates/project/html5/_fonts.scss +7 -0
  24. data/templates/project/html5/_helpers.scss +7 -0
  25. data/templates/project/html5/_media.scss +15 -0
  26. data/templates/project/index.html.haml +79 -0
  27. data/templates/project/javascripts/dd_belatedpng.js +328 -0
  28. data/templates/project/javascripts/jquery-1.4.2.min.js +154 -0
  29. data/templates/project/javascripts/modernizr-1.5.min.js +28 -0
  30. data/templates/project/javascripts/plugins.js +40 -0
  31. data/templates/project/javascripts/profiling/charts.swf +0 -0
  32. data/templates/project/javascripts/profiling/config.js +59 -0
  33. data/templates/project/javascripts/profiling/yahoo-profiling.css +7 -0
  34. data/templates/project/javascripts/profiling/yahoo-profiling.min.js +39 -0
  35. data/templates/project/javascripts/rails.js +132 -0
  36. data/templates/project/manifest.rb +66 -0
  37. data/templates/project/nginx.conf +68 -0
  38. data/templates/project/robots.txt +5 -0
  39. data/templates/project/style.scss +19 -0
  40. metadata +116 -0
@@ -0,0 +1,81 @@
1
+ Compass Html5 Boilerplate
2
+ =========================
3
+
4
+ A compass extension based on HTML5 Boilerplate by Paul Irish.
5
+
6
+ Browse [html5boilerplate.com](http://html5boilerplate.com) for the full workup.
7
+
8
+
9
+ Rails Installation
10
+ ==================
11
+
12
+ gem install html5-boilerplate
13
+ cd my_rails_project
14
+ compass init rails -r html5-boilerplate -u html5-boilerplate --force
15
+
16
+ **This will install the following files in your rails project:**
17
+ (Using `--force` flag will overwrite any files that may already exist. In most cases this is probably what you want.)
18
+
19
+ app/views/layouts/application.html.haml
20
+ app/views/layouts/_flashes.html.haml
21
+ app/views/layouts/_footer.html.haml
22
+ app/views/layouts/_head.html.haml
23
+ app/views/layouts/_header.html.haml
24
+ app/views/layouts/_javascripts.html.haml
25
+ app/views/layouts/_stylesheets.html.haml
26
+
27
+ app/stylesheets/
28
+ app/stylesheets/style.scss
29
+ app/stylesheets/handheld.scss
30
+ app/stylesheets/html5/_base.scss
31
+ app/stylesheets/html5/_defaults.scss
32
+ app/stylesheets/html5/_fonts.scss
33
+ app/stylesheets/html5/_helpers.scss
34
+ app/stylesheets/html5/_media.scss
35
+
36
+ public/.htaccess
37
+ public/404.html
38
+ public/crossdomain.xml
39
+ public/robots.txt
40
+ public/javascripts/dd_belatedpng.js
41
+ public/javascripts/jquery-1.4.2.min.js
42
+ public/javascripts/modernizr-1.5.min.js
43
+ public/javascripts/plugins.js
44
+ public/javascripts/profiling/
45
+ public/javascripts/rails.js
46
+
47
+ config/compass.rb
48
+ config/initializers/compass.rb
49
+
50
+
51
+ Note: If you already have a config/compass.rb file in your project, you may need to
52
+ manually add the following line to the top:
53
+
54
+ require 'html5-boilerplate'
55
+
56
+ ### A few more minor points to store into your brainpan...
57
+
58
+ If you still have an application.html.erb in your layouts, you might want to loose
59
+ it now so that Rails will use your shiny new application.html.haml layout instead.
60
+
61
+ This has only been tested on Rails3, but should work fine on Rails2.
62
+
63
+
64
+ Stand Alone Installation
65
+ ========================
66
+
67
+ gem install html5-boilerplate
68
+ compass create myproject -r html5-boilerplate -u html5-boilerplate --javascripts-dir js --css-dir css
69
+
70
+ The `--javascripts-dir` and `--css-dir` flags are to keep consistent with the original project layout.
71
+ If you omit them, be sure to edit your javascript and style tags accordingly in index.html.
72
+
73
+
74
+ License
75
+ =======
76
+
77
+ HTML5 Boilerplate by Paul Irish
78
+ (comments left intact in scss files)
79
+
80
+ Compass Extension Copyright (c) 2010, Peter Gumeson
81
+ [http://creativecommons.org/licenses/by/3.0](http://creativecommons.org/licenses/by/3.0)
@@ -0,0 +1 @@
1
+ Compass::Frameworks.register("html5-boilerplate", :path => "#{File.dirname(__FILE__)}/..")
@@ -0,0 +1,13 @@
1
+ @import "html5-boilerplate/reset";
2
+ @import "html5-boilerplate/base";
3
+ @import "html5-boilerplate/fonts";
4
+ @import "html5-boilerplate/helpers";
5
+ @import "html5-boilerplate/media";
6
+
7
+ @mixin html5-boilerplate {
8
+ @include html5-boilerplate-reset;
9
+ @include html5-boilerplate-base;
10
+ @include html5-boilerplate-fonts;
11
+ @include html5-boilerplate-helpers;
12
+ @include html5-boilerplate-media;
13
+ }
@@ -0,0 +1,144 @@
1
+
2
+ $html5-boilerplate-font-family: sans-serif !default;
3
+
4
+ $html5-boilerplate-fixed-font-family: "Courier New", monospace, serif !default;
5
+
6
+ $html5-boilerplate-font-size: 13px !default;
7
+
8
+ $html5-boilerplate-font-color: #444 !default; //looks better than black: twitter.com/H_FJ/statuses/11800719859
9
+
10
+ $html5-boilerplate-link-color: #607890 !default;
11
+
12
+ $html5-boilerplate-link-hover-color: #036 !default;
13
+
14
+ $html5-boilerplate-link-active-color: #607890 !default;
15
+
16
+ $html5-boilerplate-link-visited-color: #607890 !default;
17
+
18
+ $html5-boilerplate-selected-font-color: #fff !default;
19
+
20
+ $html5-boilerplate-selected-color: #FF5E99 !default;
21
+
22
+ $html5-boilerplate-selected-font-color: #fff !default;
23
+
24
+
25
+ //
26
+ // minimal base styles
27
+ //
28
+
29
+ @mixin html5-boilerplate-base {
30
+ body, select, input, textarea { color: $html5-boilerplate-font-color; }
31
+
32
+ h1,h2,h3,h4,h5,h6 { @include optimize-legibility; }
33
+
34
+ html {
35
+ @include font-smoothing;
36
+ @include force-scrollbar;
37
+ }
38
+
39
+ @include accessible-focus;
40
+
41
+ a, a:active, a:visited { color: $html5-boilerplate-link-color; }
42
+ a:hover { color: $html5-boilerplate-link-hover-color; }
43
+
44
+ ul { margin-left:30px; }
45
+ ol { margin-left:30px; list-style-type: decimal; }
46
+
47
+ small { @include small; }
48
+ strong, th { @include strong; }
49
+
50
+ td, td img { vertical-align: top; }
51
+
52
+ sub { vertical-align: sub; font-size: smaller; }
53
+ sup { vertical-align: super; font-size: smaller; }
54
+
55
+ @include quoted-pre;
56
+
57
+ @include align-input-labels;
58
+
59
+ @include hand-cursor-inputs;
60
+
61
+ @include selected-text;
62
+
63
+ @include webkit-tap-highlight;
64
+
65
+ @include ie-hacks;
66
+ }
67
+
68
+
69
+ // www.aestheticallyloyal.com/public/optimize-legibility/
70
+ @mixin optimize-legibility {
71
+ font-weight: bold; text-rendering: optimizeLegibility;
72
+ }
73
+
74
+ // maxvoltar.com/archive/-webkit-font-smoothing
75
+ @mixin font-smoothing {
76
+ -webkit-font-smoothing: antialiased;
77
+ }
78
+
79
+ // Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test
80
+ @mixin accessible-focus {
81
+ a:active { outline: none; }
82
+ a:focus { outline: thin dotted; }
83
+ }
84
+
85
+ @mixin small {
86
+ font-size: 85%;
87
+ }
88
+
89
+ @mixin strong {
90
+ font-weight: bold;
91
+ }
92
+
93
+ // www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/
94
+ @mixin quoted-pre {
95
+ pre {
96
+ padding: 15px;
97
+ white-space: pre; /* CSS2 */
98
+ white-space: pre-wrap; /* CSS 2.1 */
99
+ white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
100
+ word-wrap: break-word; /* IE */
101
+ }
102
+ }
103
+
104
+ // align checkboxes, radios, text inputs with their label
105
+ // by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css
106
+ @mixin align-input-labels {
107
+ input[type="radio"] { vertical-align: text-bottom; }
108
+ input[type="checkbox"] { vertical-align: bottom; *vertical-align: baseline; }
109
+ .ie6 input { vertical-align: text-bottom; }
110
+ }
111
+
112
+ // hand cursor on clickable input elements
113
+ @mixin hand-cursor-inputs {
114
+ label, input[type=button], input[type=submit], button { cursor: pointer; }
115
+ }
116
+
117
+ // These selection declarations have to be separate.
118
+ // No text-shadow: twitter.com/miketaylr/status/12228805301
119
+ // Also: hot pink.
120
+ @mixin selected-text {
121
+ ::-moz-selection{ background:$html5-boilerplate-selected-color; color:$html5-boilerplate-selected-font-color; text-shadow: none; }
122
+ ::selection { background:$html5-boilerplate-selected-color; color:$html5-boilerplate-selected-font-color; text-shadow: none; }
123
+ }
124
+
125
+ // j.mp/webkit-tap-highlight-color
126
+ @mixin webkit-tap-highlight {
127
+ a:link { -webkit-tap-highlight-color: #FF5E99; }
128
+ }
129
+
130
+ // always force a scrollbar in non-IE
131
+ @mixin force-scrollbar {
132
+ overflow-y: scroll;
133
+ }
134
+
135
+ @mixin ie-hacks {
136
+ // make buttons play nice in IE:
137
+ // www.viget.com/inspire/styling-the-button-element-in-internet-explorer/
138
+ button { width: auto; overflow: visible; }
139
+
140
+ // bicubic resizing for non-native sized IMG:
141
+ // code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
142
+ .ie7 img { -ms-interpolation-mode: bicubic; }
143
+ }
144
+
@@ -0,0 +1,38 @@
1
+ //
2
+ // fonts.css from the YUI Library: developer.yahoo.com/yui/
3
+ // Please refer to developer.yahoo.com/yui/fonts/ for font sizing percentages
4
+ //
5
+ // There are three custom edits:
6
+ // * remove arial, helvetica from explicit font stack
7
+ // * make the line-height relative and unit-less
8
+ // * remove the pre, code styles
9
+ //
10
+
11
+ @mixin html5-boilerplate-fonts {
12
+ body { @include body-font; }
13
+
14
+ table { @include table-font; }
15
+
16
+ select, input, textarea { @include input-font; }
17
+
18
+ pre, code, kbd, samp { @include monospace-font; }
19
+ }
20
+
21
+ @mixin body-font {
22
+ font:$html5-boilerplate-font-size $html5-boilerplate-font-family; *font-size:small; *font:x-small; line-height:1.22;
23
+ }
24
+
25
+ @mixin input-font {
26
+ font:99% $html5-boilerplate-font-family;
27
+ }
28
+
29
+ @mixin table-font {
30
+ font-size:inherit; font:100%;
31
+ }
32
+
33
+ // normalize monospace sizing
34
+ // meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/
35
+ // en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome
36
+ @mixin monospace-font {
37
+ font-family: $html5-boilerplate-fixed-font-family;
38
+ }
@@ -0,0 +1,10 @@
1
+ @mixin html5-boilerplate-handheld {
2
+ * { @include handheld; }
3
+ }
4
+
5
+ @mixin handheld {
6
+ float: none; // Screens are not big enough to account for floats
7
+ font-size: 80%; // Slightly reducing font size to reduce need to scroll
8
+ background: #fff; // As much contrast as possible
9
+ color: #000;
10
+ }
@@ -0,0 +1,48 @@
1
+ //
2
+ // Non-semantic helper classes
3
+ //
4
+
5
+ @mixin html5-boilerplate-helpers {
6
+ .ir { @include image-replacement; }
7
+
8
+ .hidden { @include hidden; }
9
+
10
+ .visuallyhidden { @include visually-hidden; }
11
+
12
+ @include magnificent-clearfix;
13
+ }
14
+
15
+ // for image replacement
16
+ @mixin image-replacement {
17
+ display:block;
18
+ text-indent:-999px;
19
+ overflow:hidden;
20
+ background-repeat: none;
21
+ }
22
+
23
+ // Hide for both screenreaders and browsers
24
+ // css-discuss.incutio.com/wiki/Screenreader_Visibility
25
+ @mixin hidden {
26
+ display:none;
27
+ visibility:hidden;
28
+ }
29
+
30
+ // Hide only visually, but have it available for screenreaders
31
+ // www.webaim.org/techniques/css/invisiblecontent/
32
+ // Solution from: j.mp/visuallyhidden - Thanks Jonathan Neal!
33
+ @mixin visually-hidden {
34
+ position: absolute !important;
35
+ clip: rect(1px 1px 1px 1px); // IE6, IE7
36
+ clip: rect(1px, 1px, 1px, 1px);
37
+ }
38
+
39
+ // Hide visually and from screenreaders, but maintain layout
40
+ @mixin invisible { visibility: hidden; }
41
+
42
+ // The Magnificent CLEARFIX
43
+ @mixin magnificent-clearfix {
44
+ .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
45
+ .clearfix { display: inline-block; }
46
+ * html .clearfix { height: 1%; } // Hides from IE-mac
47
+ .clearfix { display: block; }
48
+ }
@@ -0,0 +1,63 @@
1
+ @mixin html5-boilerplate-media {
2
+ @media print {
3
+ @include media-print;
4
+ }
5
+
6
+ @media all and (orientation:portrait) {
7
+ @include media-orientation-portrait;
8
+ }
9
+
10
+ @media all and (orientation:landscape) {
11
+ @include media-orientation-landscape;
12
+ }
13
+
14
+ @media screen and (max-device-width: 480px) {
15
+ @include media-mobile;
16
+ }
17
+ }
18
+
19
+ //
20
+ // print styles
21
+ // inlined to avoid required HTTP connection www.phpied.com/delay-loading-your-print-css/
22
+
23
+ @mixin media-print {
24
+ * { background: transparent !important; color: #444 !important; text-shadow: none; }
25
+
26
+ a, a:visited { color: #444 !important; text-decoration: underline; }
27
+
28
+ a:after { content: " (" attr(href) ")"; }
29
+
30
+ abbr:after { content: " (" attr(title) ")"; }
31
+
32
+ .ir a:after { content: ""; } /* Don't show links for images */
33
+
34
+ pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
35
+
36
+ img { page-break-inside: avoid; }
37
+
38
+ @page { margin: 0.5cm; }
39
+
40
+ p, h2, h3 { orphans: 3; widows: 3; }
41
+
42
+ h2, h3{ page-break-after: avoid; }
43
+ }
44
+
45
+
46
+ //
47
+ // Media queries for responsive design
48
+ //
49
+
50
+ @mixin media-orientation-portrait {
51
+ // Style adjustments for portrait mode goes here
52
+ }
53
+
54
+ @mixin media-orientation-landscape {
55
+ // Style adjustments for landscape mode goes here
56
+ }
57
+
58
+ // Grade-A Mobile Browsers (Opera Mobile, iPhone Safari, Android Chrome)
59
+ // Consider this: www.cloudfour.com/css-media-query-for-mobile-is-fools-gold/
60
+ @mixin media-mobile {
61
+ // Prevent iOS, WinMobile from adjusting font size
62
+ html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; }
63
+ }
@@ -0,0 +1,64 @@
1
+ //
2
+ // style.css contains a reset, font normalization and some base styles.
3
+ //
4
+ // credit is left where credit is due.
5
+ // additionally, much inspiration was taken from these projects:
6
+ // yui.yahooapis.com/2.8.1/build/base/base.css
7
+ // camendesign.com/design/
8
+ // praegnanz.de/weblog/htmlcssjs-kickstart
9
+ //
10
+ // html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
11
+ // v1.4 2009-07-27 | Authors: Eric Meyer & Richard Clark
12
+ // html5doctor.com/html-5-reset-stylesheet/
13
+ //
14
+
15
+ @mixin html5-boilerplate-reset {
16
+ html, body, div, span, object, iframe,
17
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
18
+ abbr, address, cite, code,
19
+ del, dfn, em, img, ins, kbd, q, samp,
20
+ small, strong, sub, sup, var,
21
+ b, i,
22
+ dl, dt, dd, ol, ul, li,
23
+ fieldset, form, label, legend,
24
+ table, caption, tbody, tfoot, thead, tr, th, td,
25
+ article, aside, figure, footer, header,
26
+ hgroup, menu, nav, section, menu,
27
+ time, mark, audio, video {
28
+ margin:0;
29
+ padding:0;
30
+ border:0;
31
+ outline:0;
32
+ font-size:100%;
33
+ vertical-align:baseline;
34
+ background:transparent;
35
+ }
36
+
37
+ article, aside, figure, footer, header,
38
+ hgroup, nav, section { display:block; }
39
+
40
+ nav ul { list-style:none; }
41
+
42
+ blockquote, q { quotes:none; }
43
+
44
+ blockquote:before, blockquote:after,
45
+ q:before, q:after { content:''; content:none; }
46
+
47
+ a { margin:0; padding:0; border:0; font-size:100%; vertical-align:baseline; background:transparent; }
48
+
49
+ ins { background-color:#ff9; color:#000; text-decoration:none; }
50
+
51
+ mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }
52
+
53
+ del { text-decoration: line-through; }
54
+
55
+ abbr[title], dfn[title] { border-bottom:1px dotted #000; cursor:help; }
56
+
57
+ //
58
+ // tables still need cellspacing="0" in the markup
59
+ table { border-collapse:collapse; border-spacing:0; }
60
+
61
+ hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }
62
+
63
+ input, select { vertical-align:middle; }
64
+ }