compass-less-plugin 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
4
+ .DS_Store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in compass-less-plugin.gemspec
4
+ gemspec
data/README.mkdn ADDED
@@ -0,0 +1,81 @@
1
+ Less Framework - Compass Plugin
2
+ ===============================
3
+
4
+ This plugin adds Less Framework 3 to [Compass](http://compass-style.org/).
5
+
6
+ Less Framework 3 was written by Joni Korpi. For more information, visit the official site at
7
+ [http:/lessframework.com/](http://lessframework.com/)
8
+
9
+
10
+ Installation
11
+ ============
12
+
13
+ gem install compass-less-plugin
14
+
15
+
16
+ Create a Compass Project using Less Framework
17
+ =============================================
18
+
19
+ compass create -r lessframework my_project --using less
20
+
21
+ Afterwards, edit the generated `styles.scss` file.
22
+
23
+
24
+ Customizing Typography
25
+ ======================
26
+
27
+ Less Framework contains typography settings optimized for line heights of `1.5`
28
+ and `1.3`. While this plugin defaults to `1.5`, `1.3` may be used by changing the value
29
+ of the `$less-line-height` variable before importing the `text` module:
30
+
31
+ $less-line-height: 1.3;
32
+ @import "lessframework/text";
33
+
34
+ Values other than `1.5` or `1.3` will be ignored, resulting in the default being used.
35
+
36
+
37
+ Creating a Grid
38
+ ===============
39
+
40
+ When `styles.scss` is generated, it will be pre-populated with the inline media queries
41
+ necessary to create a responsive website. If you wish to define grids in a different
42
+ manner, use the `grid(n)` mixin:
43
+
44
+ body {
45
+ @include grid(8);
46
+ }
47
+
48
+ The above example creates an 8-column grid with 60 px margins.
49
+
50
+ The number of columns, `n`, can be:
51
+
52
+ * `3` - For all iPhones, iPod Touches, and other 320 px mobile devices
53
+ * `5` - For 480 px mobile devices, narrow browsers, and landscape iPhones
54
+ * `8` - For tablets at 768 px, netbooks, and old browsers
55
+ * `13` - For laptops, desktops, and hdtvs at 1280 px and beyond.
56
+
57
+ To prevent Mobile Safari from bumping up font sizes when in landscape mode, use the
58
+ `mobile-safari` mixin:
59
+
60
+ @media only screen and (max-width: 479px) {
61
+
62
+ body {
63
+ @include grid(3);
64
+ @include mobile-safari;
65
+ }
66
+ }
67
+
68
+
69
+ Populating the Grid
70
+ ====================
71
+
72
+ To calculate the width of columns within the grid, use the `column(n, [last])` mixin:
73
+
74
+ #content {
75
+ @include column(5); /* Creates a 396 px column with a 24 px gutter on the right. */
76
+ }
77
+
78
+ #sidebar {
79
+ @include column(3, true); /* Creates a 228 px column without the right gutter. */
80
+ }
81
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "compass-less-plugin"
6
+ s.version = "0.3.1"
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["William Wells"]
9
+ s.email = ["projects@hanwells.me"]
10
+ s.homepage = "http://github.com/willhw/compass-less-plugin"
11
+ s.summary = %q{Compass compatible port of Less Framework 3}
12
+ s.description = %q{Less Framework is a cross-device CSS grid system based on using inline media queries.}
13
+
14
+ s.rubyforge_project = "compass-less-plugin"
15
+
16
+ s.add_dependency "compass", ">= 0.10"
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+
20
+ s.has_rdoc = false
21
+ s.require_paths = ["lib"]
22
+ end
@@ -0,0 +1,2 @@
1
+ require "compass"
2
+ Compass::Frameworks.register("less", :path => "#{File.dirname(__FILE__)}/..")
@@ -0,0 +1,28 @@
1
+ $less-column-width: 60px !default;
2
+ $less-gutter-width: 24px !default;
3
+
4
+ @mixin grid($columns) {
5
+ @include column($columns, true);
6
+
7
+ @if $columns == 13 {
8
+ padding: 96px 72px 0;
9
+ } @else if $columns == 5 {
10
+ padding: 60px 42px 0;
11
+ } @else if $columns == 3 {
12
+ padding: 48px 46px 0;
13
+ } @else {
14
+ padding: 84px 60px 0;
15
+ }
16
+ }
17
+
18
+ @mixin column($columns, $last: false) {
19
+ width: ($less-column-width * $columns) + ($less-gutter-width * ($columns - 1));
20
+
21
+ @if $last != true {
22
+ margin-right: $less-gutter-width;
23
+ }
24
+ }
25
+
26
+ @mixin mobile-safari {
27
+ -webkit-text-size-adjust: 100%;
28
+ }
@@ -0,0 +1,21 @@
1
+ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6,
2
+ p, blockquote, pre, a, abbr, address, cite, code, del, dfn, em,
3
+ img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i,
4
+ dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
5
+ table, caption, tbody, tfoot, thead, tr, th, td,
6
+ article, aside, canvas, details, figure, figcaption, hgroup,
7
+ menu, footer, header, nav, section, summary, time, mark, audio, video {
8
+ margin: 0;
9
+ padding: 0;
10
+ border: 0;
11
+ }
12
+
13
+ article, aside, canvas, figure, figure img, figcaption, hgroup,
14
+ footer, header, nav, section, audio, video {
15
+ display: block;
16
+ }
17
+
18
+ a img { border: 0; }
19
+
20
+ figure { position: relative; }
21
+ figure img { width: 100%; }
@@ -0,0 +1,66 @@
1
+ $less-line-height: 1.5 !default;
2
+
3
+ @mixin font-stack {
4
+ @if $less-line-height == 1.3 {
5
+ font-family: Palatino, Constantia, "Palatino Linotype", serif;
6
+ } @else {
7
+ font-family: Helvetica, Arial, sans-serif;
8
+ }
9
+ }
10
+
11
+ @mixin gigantic-font {
12
+ @if $less-line-height == 1.3 {
13
+ font-size: 123px;
14
+ line-height: 132px;
15
+ } @else {
16
+ font-size: 110px;
17
+ line-height: 120px;
18
+ }
19
+
20
+ letter-spacing: -2px;
21
+ }
22
+
23
+ @mixin huge-font {
24
+ @if $less-line-height == 1.3 {
25
+ font-size: 76px;
26
+ line-height: 84px;
27
+ letter-spacing: -2px;
28
+ } @else {
29
+ font-size: 68px;
30
+ line-height: 72px;
31
+ letter-spacing: -1px;
32
+ }
33
+ }
34
+
35
+ @mixin large-font {
36
+ @if $less-line-height == 1.3 {
37
+ font-size: 46px;
38
+ letter-spacing: -1px;
39
+ } @else {
40
+ font-size: 42px;
41
+ }
42
+ line-height: 48px;
43
+ }
44
+
45
+ @mixin big-font {
46
+ @if $less-line-height == 1.3 {
47
+ font-size: 29px;
48
+ } @else {
49
+ font-size: 26px;
50
+ }
51
+ line-height: 36px;
52
+ }
53
+
54
+ @mixin normal-font {
55
+ @if $less-line-height == 1.3 {
56
+ font-size: 18px;
57
+ } @else {
58
+ font-size: 16px;
59
+ }
60
+ line-height: 24px;
61
+ }
62
+
63
+ @mixin small-font {
64
+ font-size: 13px;
65
+ line-height: 18px;
66
+ }
@@ -0,0 +1,15 @@
1
+ stylesheet "styles.sass", :media => "all"
2
+
3
+ description "Less Framework"
4
+
5
+ help %Q{
6
+ Please see the Less Framework website for documentation:
7
+
8
+ http://lessframework.com/
9
+ }
10
+
11
+ welcome_message %Q{
12
+ Please see the Less Framework website for documentation:
13
+
14
+ http://lessframework.com/
15
+ }
@@ -0,0 +1,68 @@
1
+ /* Less Framework 3
2
+ * by Joni Korpi
3
+ * http://lessframework.com */
4
+
5
+ @import lessframework/reset
6
+ @import lessframework/grid
7
+ @import lessframework/text
8
+
9
+ h1
10
+ @include huge-font
11
+
12
+ h2
13
+ @include large-font
14
+
15
+ h3
16
+ @include big-font
17
+
18
+ ::selection
19
+ background: rgb(255,255,0)
20
+
21
+ ::-moz-selection
22
+ background: rgb(255,255,0)
23
+
24
+ img::selection
25
+ background: transparent
26
+
27
+ img::-moz-selection
28
+ background: transparent
29
+
30
+
31
+ /* Default 8-column layout
32
+ For tablets at 768 px, netbooks, and old browsers. */
33
+
34
+ body
35
+ @include grid(8)
36
+ @include font-stack
37
+ @include normal-font
38
+ background: rgb(232,232,232)
39
+ -webkit-tap-highlight-color: rgb(255,255,0)
40
+
41
+
42
+ /* 13-column layout
43
+ For laptops, desktops, and hdtvs at 1280 px and beyond. */
44
+
45
+ @media only screen and (min-width: 1212px)
46
+
47
+ body
48
+ @include grid(13)
49
+
50
+
51
+ /* 5-column layout
52
+ For 480 px mobiles, narrow browsers, and landscape iPhones. */
53
+
54
+ @media only screen and (max-width: 767px) and (min-width: 480px)
55
+
56
+ body
57
+ @include grid(5)
58
+ @include mobile-safari
59
+
60
+
61
+ /* 3-column layout
62
+ For all iPhones, iPod Touches, and other 320 px mobiles. */
63
+
64
+ @media only screen and (max-width: 479px)
65
+
66
+ body
67
+ @include grid(3)
68
+ @include mobile-safari
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-less-plugin
3
+ version: !ruby/object:Gem::Version
4
+ hash: 17
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 1
10
+ version: 0.3.1
11
+ platform: ruby
12
+ authors:
13
+ - William Wells
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-14 00:00:00 -06:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: compass
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 31
30
+ segments:
31
+ - 0
32
+ - 10
33
+ version: "0.10"
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ description: Less Framework is a cross-device CSS grid system based on using inline media queries.
37
+ email:
38
+ - projects@hanwells.me
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - .gitignore
47
+ - Gemfile
48
+ - README.mkdn
49
+ - Rakefile
50
+ - compass-less-plugin.gemspec
51
+ - lib/lessframework.rb
52
+ - stylesheets/lessframework/_grid.scss
53
+ - stylesheets/lessframework/_reset.scss
54
+ - stylesheets/lessframework/_text.scss
55
+ - templates/project/manifest.rb
56
+ - templates/project/styles.sass
57
+ has_rdoc: true
58
+ homepage: http://github.com/willhw/compass-less-plugin
59
+ licenses: []
60
+
61
+ post_install_message:
62
+ rdoc_options: []
63
+
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ hash: 3
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ requirements: []
85
+
86
+ rubyforge_project: compass-less-plugin
87
+ rubygems_version: 1.3.7
88
+ signing_key:
89
+ specification_version: 3
90
+ summary: Compass compatible port of Less Framework 3
91
+ test_files: []
92
+