adrianss-compass-oocss-plugin 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,61 @@
1
+ /*
2
+ Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3
+ Code licensed under the BSD License:
4
+ http://developer.yahoo.net/yui/license.txt
5
+ version: 3.0.0pr2
6
+
7
+ /* reset
8
+
9
+ html
10
+ color: #000
11
+ background: #FFF
12
+
13
+ body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td
14
+ margin: 0
15
+ padding: 0
16
+
17
+ table
18
+ border-collapse: collapse
19
+ border-spacing: 0
20
+
21
+ fieldset, img
22
+ border: 0
23
+
24
+ address, caption, cite, code, dfn, em, strong, th, var
25
+ font-style: normal
26
+ font-weight: normal
27
+
28
+ li
29
+ list-style: none
30
+
31
+ caption, th
32
+ text-align: left
33
+
34
+ h1, h2, h3, h4, h5, h6
35
+ font-size: 100%
36
+ font-weight: normal
37
+
38
+ q
39
+ &:before, &:after
40
+ content: ''
41
+
42
+ abbr, acronym
43
+ border: 0
44
+ font-variant: normal
45
+
46
+ sup
47
+ vertical-align: text-top
48
+
49
+ sub
50
+ vertical-align: text-bottom
51
+
52
+ input, textarea, select
53
+ font-family: inherit
54
+ font-size: inherit
55
+ font-weight: inherit
56
+
57
+ input, textarea, select
58
+ *font-size: 100%
59
+
60
+ legend
61
+ color: #000
@@ -0,0 +1,76 @@
1
+ // Talk bubbles
2
+
3
+ =talk_scaffold
4
+ /* **************** TALK BUBBLE *****************
5
+ .bubble
6
+ overflow: hidden
7
+ _overflow: visible
8
+ _zoom: 1
9
+ margin: 10px
10
+
11
+ b b
12
+ position: absolute
13
+ height: 0
14
+ width: 0
15
+ border: solid 7px transparent
16
+ /* set color to match background color for IE6
17
+ _border: 7px solid #fff
18
+
19
+ .bottom
20
+ visibility: hidden
21
+
22
+ /* top bubbles
23
+ .bubbleTop
24
+ .inner
25
+ margin-top: 7px
26
+
27
+ b b
28
+ top: 0
29
+ left: 10px
30
+ border-top-style: none
31
+
32
+ /* left bubbles
33
+ .bubbleLeft
34
+ .inner
35
+ margin-left: 7px
36
+
37
+ b b
38
+ top: 10px
39
+ left: 0
40
+ border-left-style: none
41
+
42
+ /* right bubbles
43
+ .bubbleRight
44
+ .inner
45
+ margin-right: 7px
46
+
47
+ b b
48
+ top: 10px
49
+ right: 0
50
+ border-right-style: none
51
+
52
+ /* bottom bubbles
53
+ .bubbleBottom
54
+ .inner
55
+ margin-bottom: 7px
56
+
57
+ b b
58
+ bottom: 0
59
+ left: 10px
60
+ border-bottom-style: none
61
+
62
+ .bottom
63
+ visibility: visible
64
+
65
+ /* extensions (swaps alignment of talk bubble)
66
+ /* apply to bubbleLeft or bubbleRight */
67
+ .bubbleHorizontalExt b b
68
+ top: auto
69
+ bottom: 10px
70
+ visibility: visible
71
+
72
+ /* apply to bubbleTop or bubbleBottom */
73
+ .bubbleVerticalExt b b
74
+ right: 10px
75
+ left: auto
76
+
@@ -0,0 +1,55 @@
1
+
2
+ =talk_skins_scaffold
3
+ /* yowza (extends bubbleTop)
4
+ .yowza
5
+ .inner
6
+ background-color: #d4494f
7
+
8
+ b b
9
+ border-bottom-color: #d4494f
10
+
11
+ /* discuss (extends bubbleBottom)
12
+ .discuss
13
+ .inner
14
+ background-color: #CCC
15
+
16
+ b b
17
+ border-top-color: #CCC
18
+
19
+ /* lol (extends bubbleLeft)
20
+ .lol
21
+ .inner
22
+ background-color: #845B4E
23
+
24
+ b b
25
+ border-right-color: #845B4E
26
+
27
+ /* meep (extends bubbleRight)
28
+ .meep
29
+ .inner
30
+ background-color: #6cc6c6
31
+
32
+ b b
33
+ border-left-color: #6cc6c6
34
+
35
+ /* yoyo (extends bubbleBottom)
36
+ .yoyo
37
+ .inner
38
+ background-color: #52a583
39
+
40
+ b b
41
+ border-top-color: #52a583
42
+
43
+ /* header
44
+ .fire
45
+ color: #000
46
+ font-size: 18px
47
+ border-bottom: 1px dashed #fff
48
+
49
+ *
50
+ color: #000
51
+ font-size: 18px
52
+ border-bottom: 1px dashed #fff
53
+
54
+ .attribution
55
+ margin-left: 27px
@@ -0,0 +1,81 @@
1
+ // overflow to hidden
2
+ // with hacks for ie
3
+ // inside class body must be main, left_column, etc.
4
+ =body
5
+ overflow: hidden
6
+ _overflow: visible
7
+ _zoom: 1
8
+
9
+ // #container
10
+ // +page(750px) /* oldSchool
11
+ // default = 950px
12
+ =page(!page_width=950px)
13
+ margin: 0 auto
14
+ width= !page_width
15
+
16
+ // #container
17
+ // +page /* first set to page style
18
+ // +liquid /* then extend liquid
19
+ =liquid
20
+ width: auto
21
+ margin: 0
22
+
23
+ // ====== Columns ======
24
+ =main
25
+ overflow: hidden
26
+ _overflow: visible
27
+ _zoom: 1
28
+
29
+ =left_column(!column_width=250px)
30
+ float: left
31
+ width= !column_width
32
+ _margin-right: -3px
33
+
34
+ =right_column(!column_width=300px)
35
+ float: right
36
+ width= !column_width
37
+ _margin-left: -3px
38
+
39
+
40
+ =template_scaffold
41
+ /* **************** TEMPLATE *****************
42
+ /* ====== Page Head, Body, and Foot ======
43
+ .body
44
+ +body
45
+
46
+ .page
47
+ +page
48
+
49
+ /* "old school" and "liquid" extend page to allow for different page widths
50
+ .oldSchool
51
+ width: 750px
52
+
53
+ .gs960
54
+ width: 960px
55
+
56
+ .liquid
57
+ +liquid
58
+
59
+
60
+ /* ====== Columns ======
61
+ .main
62
+ +main
63
+
64
+ .leftCol
65
+ +left_column
66
+
67
+ .rightCol
68
+ +right_column
69
+
70
+ /* extend columns to allow for common column widths
71
+ .gMail
72
+ width: 160px
73
+
74
+ .gCal
75
+ width: 180px
76
+
77
+ .yahoo
78
+ width: 240px
79
+
80
+ .myYahoo
81
+ width: 300px
@@ -0,0 +1,15 @@
1
+ /* **************** TEMPLATE DEBUG *****************
2
+ .body
3
+ background-color: red
4
+
5
+ .page
6
+ background-color: orange
7
+
8
+ .main
9
+ background-color: yellow
10
+
11
+ .leftCol
12
+ background-color: lime
13
+
14
+ .rightCol
15
+ background-color: aqua
@@ -0,0 +1,58 @@
1
+ require 'fileutils'
2
+ require 'compass'
3
+ require 'compass/exec'
4
+ require 'timeout'
5
+ require File.dirname(__FILE__) + '/spec_helper'
6
+ require 'compass-oocss-plugin'
7
+
8
+ include Compass::CommandLineHelper
9
+ include Compass::TestCaseHelper
10
+
11
+ Spec::Matchers.define :exist do
12
+ match do |thisfile|
13
+ File.exist?(thisfile)
14
+ end
15
+
16
+ failure_message_for_should do |thisfile|
17
+ "expected file: #{thisfile} exist"
18
+ end
19
+
20
+ failure_message_for_should_not do |thisfile|
21
+ "expected file: #{thisfile} not exist"
22
+ end
23
+
24
+ description do
25
+ "expected a file exist "
26
+ end
27
+ end
28
+
29
+ describe "compass-oocss-plugin" do
30
+
31
+ before(:each) do
32
+ Compass.configuration.reset!
33
+ end
34
+
35
+ it "should show version" do
36
+ compass "-vq"
37
+ @last_result.should match(/\d+\.\d+\.\d+( [0-9a-f]+)?/)
38
+ end
39
+
40
+ it "should include oocss in list of frameworks" do
41
+ compass "--list-frameworks"
42
+ @last_result.split.should include("oocss")
43
+ end
44
+
45
+ it "should install framework" do
46
+ dir_name="oocss_project"
47
+ within_tmp_directory do
48
+ compass *%W(--framework oocss #{dir_name})
49
+ "#{dir_name}/src/screen.sass".should exist
50
+ "#{dir_name}/stylesheets/screen.css".should exist
51
+ "#{dir_name}/src/partials/_ie6hacks.sass".should exist
52
+ "#{dir_name}/src/partials/_ie7hacks.sass".should exist
53
+ "#{dir_name}/src/screen.sass".should exist
54
+ end
55
+ end
56
+
57
+
58
+ end
@@ -0,0 +1,113 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+ require 'sass'
3
+ require 'compass-oocss-plugin'
4
+
5
+ def compile_sass(sass_code)
6
+ sass_engine = Sass::Engine.new(sass_code)
7
+ output = sass_engine.render
8
+ end
9
+
10
+ describe "grids system" do
11
+
12
+ it "should create a oocss unit" do
13
+ sass_code = <<SASS
14
+ @import sass/oocss/grids.sass
15
+
16
+ .myblock
17
+ +unit
18
+ SASS
19
+
20
+ css_code = <<CSS
21
+ .myblock {
22
+ float: left;
23
+ /* _zoom:1; */ }
24
+ CSS
25
+ compile_sass(sass_code).should == css_code
26
+ end
27
+
28
+ it "should create a oocss line" do
29
+ sass_code = <<SASS
30
+ @import sass/oocss/grids.sass
31
+
32
+ .row
33
+ +line
34
+ SASS
35
+
36
+ css_code = <<CSS
37
+ .row {
38
+ _zoom: 1; }
39
+ .row:after {
40
+ content: ".";
41
+ display: block;
42
+ height: 0;
43
+ clear: both;
44
+ visibility: hidden; }
45
+ CSS
46
+ compile_sass(sass_code).should == css_code
47
+ end
48
+
49
+ it "should mixin unit size1of3 last" do
50
+ sass_code = <<SASS
51
+ @import sass/oocss/grids.sass
52
+
53
+ .my-last-block
54
+ +unit
55
+ +size1of3
56
+ +last_unit
57
+ SASS
58
+
59
+ css_code = <<CSS
60
+ .my-last-block {
61
+ float: left;
62
+ /* _zoom:1; */
63
+ width: 33.33333%;
64
+ display: table-cell;
65
+ float: none;
66
+ width: auto;
67
+ _display: block;
68
+ _position: relative;
69
+ _left: -3px;
70
+ _margin-right: -3px; }
71
+ CSS
72
+ compile_sass(sass_code).should == css_code
73
+ end
74
+
75
+ it "+column(1/3, true) should equal +unit +size1of3 +last" do
76
+ sass_column = <<SASS
77
+ @import sass/oocss/grids.sass
78
+
79
+ .my-last-block
80
+ +column(1/3, true)
81
+ SASS
82
+
83
+ sass_mixins = <<SASS
84
+ @import sass/oocss/grids.sass
85
+
86
+ .my-last-block
87
+ +unit
88
+ +size1of3
89
+ +last_unit
90
+ SASS
91
+ compile_sass(sass_column).should == compile_sass(sass_mixins)
92
+ end
93
+
94
+ it "+column(2/5) should equal +size2of5" do
95
+ sass_column = <<SASS
96
+ @import sass/oocss/grids.sass
97
+
98
+ .my-last-block
99
+ +column(2/5)
100
+ SASS
101
+
102
+ sass_mixins = <<SASS
103
+ @import sass/oocss/grids.sass
104
+
105
+ .my-last-block
106
+ +unit
107
+ +size2of5
108
+ SASS
109
+ compile_sass(sass_column).should == compile_sass(sass_mixins)
110
+ end
111
+
112
+
113
+ end