compass-html5 0.0.1

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.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,3 @@
1
+ Copyright (c) 2010-2011 Peter Gumeson
2
+
3
+ http://creativecommons.org/licenses/by/3.0/
@@ -0,0 +1,12 @@
1
+ Compass Html5
2
+ =========================
3
+
4
+ A compass extension of common html5 mixins extracted from html5-boilerplate and other libraries.
5
+
6
+
7
+ Included libraries
8
+ =========================
9
+
10
+ * CSS extraction of Paul Irish's Html5 Boilerplate
11
+
12
+ (More soon)
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "compass/html5/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "compass-html5"
7
+ s.version = Compass::Html5::VERSION
8
+ s.authors = ["Peter Gumeson"]
9
+ s.email = ["gumeson@gmail.com"]
10
+ s.homepage = "http://rubygems.org/gems/compass-html5"
11
+ s.summary = %q{A compass extension of common html5 mixins extracted from html5-boilerplate.}
12
+ s.description = %q{}
13
+
14
+ s.rubyforge_project = "compass-html5"
15
+
16
+ s.add_dependency("compass", ["~> 0.11.1"])
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+ end
@@ -0,0 +1 @@
1
+ require "compass/html5"
@@ -0,0 +1,7 @@
1
+ require "compass/html5/version"
2
+
3
+ module Compass
4
+ module Html5
5
+ Compass::Frameworks.register("compass-html5", :path => "#{File.dirname(__FILE__)}/../..")
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ module Compass
2
+ module Html5
3
+ VERSION = "0.0.1"
4
+ HTML5_BOILERPLATE_VERSION = "1.0"
5
+ end
6
+ end
@@ -0,0 +1,20 @@
1
+ // HTML5 Boilerplate
2
+ //
3
+ // Credit is left where credit is due.
4
+ // Much inspiration was taken from these projects:
5
+ // - yui.yahooapis.com/2.8.1/build/base/base.css
6
+ // - camendesign.com/design/
7
+ // - praegnanz.de/weblog/htmlcssjs-kickstart
8
+
9
+ @import "boilerplate/reset";
10
+ @import "boilerplate/fonts";
11
+ @import "boilerplate/styles";
12
+ @import "boilerplate/helpers";
13
+ @import "boilerplate/media";
14
+
15
+ @mixin html5-boilerplate {
16
+ @include html5-boilerplate-reset;
17
+ @include html5-boilerplate-fonts;
18
+ @include html5-boilerplate-styles;
19
+ @include html5-boilerplate-helpers;
20
+ }
@@ -0,0 +1,38 @@
1
+ $base-font-family: unquote("sans-serif") !default;
2
+ $base-font-size: 13px !default;
3
+ $base-line-height: 1.231 !default;
4
+
5
+ //
6
+ // Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
7
+ // Whatever parts of this port of YUI to Sass that are copyrightable, are Copyright (c) 2008, Christopher Eppstein. All Rights Reserved.
8
+ //
9
+
10
+ @mixin html5-boilerplate-fonts($family: $base-font-family, $size: $base-font-size, $line-height: $base-line-height) {
11
+ body {
12
+ font-size: $size;
13
+ font-family: $family;
14
+ line-height: $line-height; // hack retained to preserve specificity
15
+ *font-size: small;
16
+ }
17
+
18
+ // Normalize monospace sizing:
19
+ // en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome
20
+ pre, code, kbd, samp { font-family: monospace, sans-serif; }
21
+ }
22
+
23
+ // Sets the font size specified in pixels using percents so that the base
24
+ // font size changes and 1em has the correct value. When nesting font size
25
+ // declarations, within the DOM tree, the base_font_size must be the parent's
26
+ // effective font-size in pixels.
27
+ // Usage Examples:
28
+ // .big
29
+ // +font-size(16px)
30
+ // .bigger
31
+ // +font-size(18px)
32
+ // .big .bigger
33
+ // +font-size(18px, 16px)
34
+ //
35
+ // For more information see the table found at http://developer.yahoo.com/yui/3/cssfonts/#fontsize
36
+ @mixin font-size($size, $base-font-size: $base-font-size) {
37
+ font-size: ceil(percentage($size / $base-font-size));
38
+ }
@@ -0,0 +1,64 @@
1
+ @import "compass/typography/text/replacement";
2
+ @import "compass/utilities/general/clearfix";
3
+
4
+ //
5
+ // Non-semantic helper classes
6
+ // It's better to include these mixins in your own styles
7
+ //
8
+
9
+ @mixin html5-boilerplate-helpers {
10
+ .ir { @include image-replacement; }
11
+
12
+ .hidden { @include hidden; }
13
+
14
+ .visuallyhidden { @include visually-hidden; }
15
+
16
+ .clearfix { @include micro-clearfix; }
17
+ }
18
+
19
+ // Almost the same as compass replace-text
20
+ // but adding direction: ltr
21
+ @mixin image-replacement($img: none, $x: 50%, $y: 50%) {
22
+ @include hide-text;
23
+ direction: ltr;
24
+ background-repeat: no-repeat;
25
+ @if $img != none {
26
+ background-image: image-url($img);
27
+ background-position: $x $y;
28
+ }
29
+ }
30
+
31
+ @mixin sized-image-replacement($img, $x: 50%, $y: 50%) {
32
+ @include image-replacement($img, $x, $y);
33
+ width: image-width($img);
34
+ height: image-height($img);
35
+ }
36
+
37
+ // Hide for both screenreaders and browsers
38
+ // css-discuss.incutio.com/wiki/Screenreader_Visibility
39
+ @mixin hidden {
40
+ display:none;
41
+ visibility: hidden;
42
+ }
43
+
44
+ // Hide only visually, but have it available for screenreaders: by Jon Neal
45
+ // www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden
46
+ @mixin visually-hidden {
47
+ border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
48
+ // Extends the .visuallyhidden class to allow the element to be focusable
49
+ // when navigated to via the keyboard: drupal.org/node/897638
50
+ &.focusable:active, &.focusable:focus {
51
+ clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto;
52
+ }
53
+ }
54
+
55
+ // Hide visually and from screenreaders, but maintain layout
56
+ @mixin invisible { visibility: hidden; }
57
+
58
+ // The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements in most situations.
59
+ // nicolasgallagher.com/micro-clearfix-hack/
60
+ @mixin micro-clearfix {
61
+ &:before, &:after { content: ""; display: table; }
62
+ &:after { clear: both; }
63
+ zoom: 1;
64
+ }
@@ -0,0 +1,19 @@
1
+ //
2
+ // Print styles
3
+ // Inlined to avoid required HTTP connection www.phpied.com/delay-loading-your-print-css/
4
+
5
+ @mixin media-print {
6
+ * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
7
+ -ms-filter: none !important; } // Black prints faster: sanbeiji.com/archives/953
8
+ a, a:visited { color: #444 !important; text-decoration: underline; }
9
+ a[href]:after { content: " (" attr(href) ")"; }
10
+ abbr[title]:after { content: " (" attr(title) ")"; }
11
+ .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } // Don't show links for images, or javascript/internal links
12
+ pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
13
+ thead { display: table-header-group; } // css-discuss.incutio.com/wiki/Printing_Tables
14
+ tr, img { page-break-inside: avoid; }
15
+ img { max-width: 100% !important; }
16
+ @page { margin: 0.5cm; }
17
+ p, h2, h3 { orphans: 3; widows: 3; }
18
+ h2, h3{ page-break-after: avoid; }
19
+ }
@@ -0,0 +1,43 @@
1
+ // html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
2
+ // v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
3
+ // html5doctor.com/html-5-reset-stylesheet/
4
+
5
+ @mixin html5-boilerplate-reset {
6
+ html, body, div, span, object, iframe,
7
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
+ abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
9
+ small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
10
+ fieldset, form, label, legend,
11
+ table, caption, tbody, tfoot, thead, tr, th, td,
12
+ article, aside, canvas, details, figcaption, figure,
13
+ footer, header, hgroup, menu, nav, section, summary,
14
+ time, mark, audio, video {
15
+ margin: 0;
16
+ padding: 0;
17
+ border: 0;
18
+ font-size: 100%;
19
+ vertical-align: baseline;
20
+ }
21
+
22
+ article, aside, details, figcaption, figure,
23
+ footer, header, hgroup, menu, nav, section {
24
+ display: block;
25
+ }
26
+
27
+ blockquote, q { quotes: none; }
28
+
29
+ blockquote:before, blockquote:after,
30
+ q:before, q:after { content: ""; content: none; }
31
+
32
+ ins { background-color: #ff9; color: #000; text-decoration: none; }
33
+
34
+ mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
35
+
36
+ del { text-decoration: line-through; }
37
+
38
+ abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
39
+
40
+ table { border-collapse: collapse; border-spacing: 0; }
41
+
42
+ hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
43
+ }
@@ -0,0 +1,116 @@
1
+ $font-color: #444 !default; //looks better than black: twitter.com/H_FJ/statuses/11800719859
2
+ $link-color: #607890 !default;
3
+ $link-hover-color: #036 !default;
4
+ $link-active-color: #607890 !default;
5
+ $link-visited-color: #607890 !default;
6
+ $selected-font-color: #fff !default;
7
+ $selected-background-color: #ff5e99 !default;
8
+ $list-left-margin: 1.8em !default;
9
+
10
+ //
11
+ // Minimal base styles
12
+ //
13
+ @mixin html5-boilerplate-styles {
14
+ html { @include force-scrollbar; }
15
+
16
+ ul, ol { margin-left: $list-left-margin; }
17
+ ol { list-style-type: decimal; }
18
+
19
+ td { vertical-align: top; }
20
+
21
+ sub { @include sub; }
22
+
23
+ sup { @include sup; }
24
+
25
+ @include accessible-focus;
26
+
27
+ @include quoted-pre;
28
+
29
+ @include hand-cursor-inputs;
30
+
31
+ @include reset-form-elements;
32
+
33
+ @include selected-text;
34
+
35
+ @include webkit-tap-highlight;
36
+
37
+ @include ie-hacks;
38
+
39
+ @include no-nav-margins;
40
+ }
41
+
42
+ // set sub, sup without affecting line-height: gist.github.com/413930
43
+ @mixin sub{
44
+ font-size: 75%; line-height: 0; position: relative; bottom: -0.25em;
45
+ }
46
+ @mixin sup{
47
+ font-size: 75%; line-height: 0; position: relative; top: -0.5em;
48
+ }
49
+
50
+ // accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test
51
+ @mixin accessible-focus {
52
+ a:hover, a:active { outline: none; }
53
+ }
54
+
55
+ // www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap
56
+ @mixin quoted-pre {
57
+ pre {
58
+ white-space: pre; white-space: pre-wrap; word-wrap: break-word;
59
+ padding: 15px;
60
+ }
61
+ }
62
+
63
+ // Hand cursor on clickable input elements
64
+ @mixin hand-cursor-inputs {
65
+ label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
66
+ }
67
+
68
+ @mixin reset-form-elements {
69
+ // 1) Make inputs and buttons play nice in IE: www.viget.com/inspire/styling-the-button-element-in-internet-explorer/
70
+ // 2) WebKit browsers add a 2px margin outside the chrome of form elements.
71
+ // Firefox adds a 1px margin above and below textareas
72
+ // 3) Set font-size to match <body>'s, and font-family to sans-serif
73
+ // 4) Align to baseline
74
+ button, input, select, textarea { width: auto; overflow: visible; margin: 0; font-size: 100%; font-family: sans-serif; vertical-align: baseline; }
75
+
76
+ // 1) Remove default scrollbar in IE: www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/
77
+ // 2) Align to text-top
78
+ textarea { overflow: auto; vertical-align: text-top; }
79
+
80
+ // Remove extra padding and inner border in Firefox
81
+ input::-moz-focus-inner,
82
+ button::-moz-focus-inner { border: 0; padding: 0; }
83
+ }
84
+
85
+ // These selection declarations have to be separate.
86
+ // No text-shadow: twitter.com/miketaylr/status/12228805301
87
+ // Also: hot pink!
88
+ @mixin selected-text {
89
+ ::-moz-selection{ background:$selected-background-color; color: $selected-font-color; text-shadow: none; }
90
+ ::selection { background: $selected-background-color; color: $selected-font-color; text-shadow: none; }
91
+ }
92
+
93
+ // j.mp/webkit-tap-highlight-color
94
+ @mixin webkit-tap-highlight {
95
+ a:link { -webkit-tap-highlight-color: $selected-background-color; }
96
+ }
97
+
98
+ // 1) Always force a scrollbar in non-IE
99
+ // 2) Remove iOS text size adjust without disabling user zoom:
100
+ // www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
101
+ @mixin force-scrollbar {
102
+ overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;
103
+ }
104
+
105
+ @mixin ie-hacks {
106
+ // Bicubic resizing for non-native sized IMG:
107
+ // code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
108
+ .ie7 img { -ms-interpolation-mode: bicubic; }
109
+
110
+ .ie6 legend, .ie7 legend { margin-left: -7px; }
111
+ }
112
+
113
+ @mixin no-nav-margins {
114
+ // remove margins for navigation lists
115
+ nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
116
+ }
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-html5
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Peter Gumeson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-06-20 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: compass
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: 0.11.1
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ description: ""
28
+ email:
29
+ - gumeson@gmail.com
30
+ executables: []
31
+
32
+ extensions: []
33
+
34
+ extra_rdoc_files: []
35
+
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - LICENSE
40
+ - README.md
41
+ - Rakefile
42
+ - compass-html5.gemspec
43
+ - lib/compass-html5.rb
44
+ - lib/compass/html5.rb
45
+ - lib/compass/html5/version.rb
46
+ - stylesheets/html5/_boilerplate.scss
47
+ - stylesheets/html5/boilerplate/_fonts.scss
48
+ - stylesheets/html5/boilerplate/_helpers.scss
49
+ - stylesheets/html5/boilerplate/_media.scss
50
+ - stylesheets/html5/boilerplate/_reset.scss
51
+ - stylesheets/html5/boilerplate/_styles.scss
52
+ has_rdoc: true
53
+ homepage: http://rubygems.org/gems/compass-html5
54
+ licenses: []
55
+
56
+ post_install_message:
57
+ rdoc_options: []
58
+
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: "0"
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ requirements: []
74
+
75
+ rubyforge_project: compass-html5
76
+ rubygems_version: 1.6.2
77
+ signing_key:
78
+ specification_version: 3
79
+ summary: A compass extension of common html5 mixins extracted from html5-boilerplate.
80
+ test_files: []
81
+