compass-drupal-plugin 0.1.0

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,30 @@
1
+ Gem::Specification.new do |s|
2
+ # Release Specific Information
3
+ s.version = "0.1.0"
4
+ s.date = "2010-11-12"
5
+
6
+ # Gem Details
7
+ s.name = %q{compass-drupal-plugin}
8
+ s.authors = ["Capi /. Etheriel"]
9
+ s.summary = %q{a compass extension providing drupal integration}
10
+ s.description = %q{a compass extension providing drupal integration, supporting the popular base theme Zen}
11
+ s.email = %q{barraponto@gmail.com}
12
+ s.homepage = %q{http://bitbucket.org/barraponto/drupal-compass-extension/}
13
+
14
+ # Gem Files
15
+ # s.files = %w(README.mkdn)
16
+ s.files = [
17
+ "compass-drupal-plugin.gemspec",
18
+ "lib/drupal.rb",
19
+ "stylesheets/drupal/_zen.scss",
20
+ "templates/zen/zen-base-rtl.scss",
21
+ "templates/zen/zen-base.scss",
22
+ "templates/zen/manifest.rb"
23
+ ]
24
+
25
+ # Gem Bookkeeping
26
+ s.require_paths = ["lib"]
27
+ s.has_rdoc = false
28
+ s.rubygems_version = %q{1.3.7}
29
+ s.add_dependency("compass", [">= 0.10.5"])
30
+ end
@@ -0,0 +1,2 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register("drupal", :path => "#{File.dirname(__FILE__)}/..")
@@ -0,0 +1,324 @@
1
+ @import 'compass';
2
+
3
+ $zen-width: 960px !default;
4
+ $zen-content-position: "middle" !default; //possible values are first, middle, last
5
+ $zen-first-sidebar-width: 200px !default;
6
+ $zen-second-sidebar-width: 200px !default;
7
+ $zen-navigation-width: 100% !default;
8
+ $zen-navigation-height: 2.3em !default;
9
+
10
+ //TODO: liquid
11
+
12
+ @mixin zen-layout-base {
13
+
14
+ .region-header {
15
+ clear: both; }
16
+
17
+ #main-wrapper {
18
+ position: relative; }
19
+
20
+ #page-wrapper, .region-page-closure {
21
+ margin-left: auto;
22
+ margin-right: auto;
23
+ width: $zen-width; }
24
+
25
+ }
26
+
27
+ @mixin zen-layout-fixed($direction: "ltr") {
28
+
29
+ @include zen-layout-base;
30
+
31
+ $first: "left";
32
+ $last: "right";
33
+
34
+ @if $direction == "rtl" {
35
+ $first: "right";
36
+ $last: "left"; }
37
+
38
+ #content {
39
+ width: $zen-width;
40
+ @include float($first);
41
+ padding: 0;
42
+
43
+ .no-sidebars & {
44
+ width: $zen-width;
45
+ margin-#{$first}: 0;
46
+ margin-#{$last}: -($zen-width); }
47
+
48
+ .sidebar-first & {
49
+ width: $zen-width - $zen-first-sidebar-width;
50
+
51
+ @if $zen-content-position == "first" {
52
+ margin-#{$first}: 0;
53
+ margin-#{$last}: -($zen-width - $zen-first-sidebar-width); }
54
+
55
+ @else {
56
+ margin-#{$first}: $zen-first-sidebar-width;
57
+ margin-#{$last}: -($zen-width); } }
58
+
59
+ .sidebar-second & {
60
+ width: $zen-width - $zen-second-sidebar-width;
61
+
62
+ @if $zen-content-position == "last" {
63
+ margin-#{$first}: $zen-second-sidebar-width;
64
+ margin-#{$last}: -($zen-width); }
65
+
66
+ @else {
67
+ margin-#{$first}: 0;
68
+ margin-#{$last}: -($zen-width - $zen-second-sidebar-width); } }
69
+
70
+ .two-sidebars & {
71
+ width: $zen-width - $zen-first-sidebar-width - $zen-second-sidebar-width;
72
+
73
+ @if $zen-content-position == "middle" {
74
+ margin-#{$first}: $zen-first-sidebar-width;
75
+ margin-#{$last}: -($zen-width - $zen-second-sidebar-width); }
76
+
77
+ @if $zen-content-position == "first" {
78
+ margin-#{$first}: 0;
79
+ margin-#{$last}: -($zen-width - $zen-first-sidebar-width - $zen-second-sidebar-width); }
80
+
81
+ @if $zen-content-position == "last" {
82
+ margin-#{$first}: $zen-first-sidebar-width + $zen-second-sidebar-width;
83
+ margin-#{$last}: -($zen-width); } } }
84
+
85
+ .region-sidebar-first {
86
+ @include float($first);
87
+ width: $zen-first-sidebar-width;
88
+
89
+ @if $zen-content-position == "first" {
90
+ margin-#{$first}: $zen-width - $zen-first-sidebar-width;
91
+ margin-#{$last}: -($zen-width);
92
+
93
+ .two-sidebars & {
94
+ margin-#{$first}: $zen-width - $zen-first-sidebar-width - $zen-second-sidebar-width;
95
+ margin-#{$last}: -($zen-width - $zen-second-sidebar-width); } }
96
+
97
+ @else {
98
+ margin-#{$first}: 0;
99
+ margin-#{$last}: -$zen-first-sidebar-width; } }
100
+
101
+ .region-sidebar-second {
102
+ @include float($first);
103
+ width: $zen-second-sidebar-width;
104
+
105
+ @if $zen-content-position == "last" {
106
+ margin-#{$first}: 0;
107
+ margin-#{$last}: -$zen-second-sidebar-width;
108
+
109
+ .two-sidebars & {
110
+ margin-#{$first}: $zen-first-sidebar-width;
111
+ margin-#{$last}: -($zen-second-sidebar-width + $zen-first-sidebar-width); } }
112
+
113
+ @else {
114
+ margin-#{$first}: $zen-width - $zen-second-sidebar-width;
115
+ margin-#{$last}: -($zen-width);
116
+
117
+ .two-sidebars & {
118
+ margin-#{$first}: $zen-width - $zen-second-sidebar-width;
119
+ margin-#{$last}: -($zen-width - $zen-second-sidebar-width); } } }
120
+
121
+ #content .section {
122
+ margin: 0;
123
+ padding: 0; }
124
+
125
+ }
126
+
127
+ @mixin zen-layout-liquid($direction: "ltr") {
128
+
129
+ @include zen-layout-base;
130
+
131
+ $first: "left";
132
+ $last: "right";
133
+
134
+ @if $direction == "rtl" {
135
+ $first: "right";
136
+ $last: "left"; }
137
+
138
+ #page-wrapper, .region-page-closure {
139
+ min-width: 960px; }
140
+
141
+ #content {
142
+ @include float($first);
143
+ width: 100%;
144
+ margin-#{$first}: 0;
145
+ margin-#{$last}: -100%;
146
+ padding: 0;
147
+
148
+ .section {
149
+ margin: 0;
150
+ padding: 0; } }
151
+
152
+ .region-sidebar {
153
+ padding: 0;
154
+ margin: 0;
155
+
156
+ .section {
157
+ padding: 0;
158
+ margin: 0; } }
159
+
160
+ .region-sidebar-first {
161
+ @extend .region-sidebar;
162
+ width: $zen-first-sidebar-width; }
163
+
164
+ .region-sidebar-second {
165
+ @extend .region-sidebar;
166
+ width: $zen-second-sidebar-width; }
167
+
168
+ .no-sidebars #content .section {
169
+ margin: 0;
170
+ padding: 0; }
171
+
172
+ @if $zen-content-position == "first" {
173
+
174
+ .sidebar-first #content .section {
175
+ padding-#{$last}: $zen-first-sidebar-width; }
176
+
177
+ .sidebar-second #content .section {
178
+ padding-#{$last}: $zen-second-sidebar-width; }
179
+
180
+ .two-sidebars #content .section {
181
+ padding-#{$last}: $zen-first-sidebar-width + $zen-second-sidebar-width; }
182
+
183
+ .region-sidebar-first {
184
+ @include float($last);
185
+ margin-#{$first}: -$zen-second-sidebar-width;
186
+
187
+ .two-sidebars & {
188
+ margin-#{$first}: 0;
189
+ margin-#{$last}: $zen-second-sidebar-width;
190
+ }
191
+
192
+ .section {
193
+ margin-#{$first}: 20px; } }
194
+
195
+ .region-sidebar-second {
196
+ @include float($last);
197
+ margin-#{$first}: - $zen-second-sidebar-width;
198
+
199
+ .two-sidebars & {
200
+ margin-#{$first}: 0;
201
+ margin-#{$last}: -($zen-first-sidebar-width + $zen-second-sidebar-width);
202
+ }
203
+
204
+ .section {
205
+ margin-#{$first}: 20px; } } }
206
+
207
+ @if $zen-content-position == "middle" {
208
+
209
+ .sidebar-first #content .section {
210
+ padding-#{$first}: $zen-first-sidebar-width; }
211
+
212
+ .sidebar-second #content .section {
213
+ padding-#{$last}: $zen-second-sidebar-width; }
214
+
215
+ .two-sidebars #content .section {
216
+ padding-#{$first}: $zen-first-sidebar-width;
217
+ padding-#{$last}: $zen-second-sidebar-width; }
218
+
219
+ .region-sidebar-first {
220
+ @include float($first);
221
+
222
+ .section {
223
+ margin-#{$last}: 20px; } }
224
+
225
+ .region-sidebar-second {
226
+ @include float($last);
227
+
228
+ .section {
229
+ margin-#{$first}: 20px; } } }
230
+
231
+ @if $zen-content-position == "last" {
232
+
233
+ .sidebar-first #content .section {
234
+ padding-#{$first}: $zen-first-sidebar-width; }
235
+
236
+ .sidebar-second #content .section {
237
+ padding-#{$first}: $zen-second-sidebar-width; }
238
+
239
+ .two-sidebars #content .section {
240
+ padding-#{$first}: $zen-first-sidebar-width + $zen-second-sidebar-width; }
241
+
242
+ .region-sidebar-first {
243
+ @include float($first);
244
+ margin-#{$last}: -$zen-second-sidebar-width;
245
+
246
+ .two-sidebars & {
247
+ margin-#{$last}: $zen-second-sidebar-width;
248
+ margin-#{$first}: 0; }
249
+
250
+ .section {
251
+ margin-#{$last}: 20px; } }
252
+
253
+ .region-sidebar-second {
254
+ @include float($first);
255
+ margin-#{$last}: - $zen-second-sidebar-width;
256
+
257
+ .two-sidebars & {
258
+ margin-#{$first}: - $zen-second-sidebar-width;
259
+ margin-#{$last}: 0;
260
+ }
261
+
262
+ .section {
263
+ margin-#{$last}: 20px; } } }
264
+
265
+ }
266
+
267
+ @mixin zen-layout($direction: "ltr") {
268
+
269
+ @if unit($zen-width) == "px" {
270
+ @include zen-layout-fixed($direction); }
271
+
272
+ @else if unit($zen-width) == "%" {
273
+ @include zen-layout-liquid($direction); }
274
+
275
+ }
276
+
277
+ @mixin zen-navigation($direction: "ltr") {
278
+
279
+ $first: "left";
280
+ $last: "right";
281
+
282
+ @if $direction == "rtl" {
283
+ $first: "right";
284
+ $last: "left";
285
+ }
286
+
287
+ #navigation {
288
+ overflow: hidden;
289
+ @include float($first);
290
+ width: 100%;
291
+ margin-#{$first}: 0;
292
+ margin-#{$last}: -100%;
293
+ padding: 0;
294
+ height: $zen-navigation-height;
295
+
296
+ ul {
297
+ margin: 0;
298
+ padding: 0;
299
+ text-align: $first; }
300
+
301
+ li {
302
+ @include float($first);
303
+ padding: 0;
304
+ padding-#{$last}: 10px; } }
305
+
306
+ .with-navigation {
307
+ #content, .region-sidebar-first, .region-sidebar-second {
308
+ margin-top: $zen-navigation-height; } }
309
+
310
+ }
311
+
312
+ @mixin zen-dropdown-navigation {
313
+
314
+ #navigation {
315
+ overflow: visible; }
316
+
317
+ }
318
+
319
+ @mixin zen-clearfix-fix { //ironic, isn't it?
320
+
321
+ #page-wrapper {
322
+ overflow-y: hidden; }
323
+
324
+ }
@@ -0,0 +1,16 @@
1
+ # Make sure you list all the project template files here in the manifest.
2
+ stylesheet 'zen-base.scss', :media => 'screen, projection', :to => "#{options[:project_name]}.scss"
3
+ stylesheet 'zen-base-rtl.scss', :media => 'screen, projection', :to => "#{options[:project_name]}-rtl.scss"
4
+
5
+ description "Zen Layout for Drupal Zen Theme"
6
+
7
+ help %Q{
8
+ This plugin starts a Zen layout stylesheet in your Compass project
9
+ }
10
+
11
+ welcome_message %Q{
12
+ The Zen layout stylesheet has been created.
13
+ You need to add it to YOURTHEME.info in order to load it into Drupal.
14
+ If either zen-fixed.css or zen-liquid.css are declared on YOURTHEME.info,
15
+ you should comment it to avoid CSS conflicts.
16
+ }
@@ -0,0 +1,25 @@
1
+ // This file will generate proper RTL layout
2
+
3
+ @import "drupal/zen";
4
+
5
+ // This variable controls the total width of the Zen theme.
6
+ // You can use px for a Fixed layout or % for a Liquid layout
7
+ $zen-width: 960px;
8
+
9
+ // These variables control the size of the sidebars
10
+ $zen-first-sidebar-width: 200px;
11
+ $zen-second-sidebar-width: 200px;
12
+
13
+ // This variable positions the content relative to the sidebars
14
+ // Possible values are first, last, middle
15
+ $zen-content-position: "middle";
16
+
17
+ // Use this mixin to generate the Zen layout
18
+ @include zen-layout("rtl");
19
+
20
+ // These variables control the #navigation div
21
+ $zen-navigation-width: 100%;
22
+ $zen-navigation-height: 2.3em;
23
+
24
+ // Use this mixin to properly position the #navigation div
25
+ @include zen-navigation("rtl");
@@ -0,0 +1,23 @@
1
+ @import "drupal/zen";
2
+
3
+ // This variable controls the total width of the Zen theme.
4
+ // You can use px for a Fixed layout or % for a Liquid layout
5
+ $zen-width: 960px;
6
+
7
+ // These variables control the size of the sidebars
8
+ $zen-first-sidebar-width: 200px;
9
+ $zen-second-sidebar-width: 200px;
10
+
11
+ // This variable positions the content relative to the sidebars
12
+ // Possible values are first, last, middle
13
+ $zen-content-position: "middle";
14
+
15
+ // Use this mixin to generate the Zen layout
16
+ @include zen-layout();
17
+
18
+ // These variables control the #navigation div
19
+ $zen-navigation-width: 100%;
20
+ $zen-navigation-height: 2.3em;
21
+
22
+ // Use this mixin to properly position the #navigation div
23
+ @include zen-navigation();
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-drupal-plugin
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Capi /. Etheriel
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-11-12 00:00:00 -02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: compass
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 10
31
+ - 5
32
+ version: 0.10.5
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: a compass extension providing drupal integration, supporting the popular base theme Zen
36
+ email: barraponto@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - compass-drupal-plugin.gemspec
45
+ - lib/drupal.rb
46
+ - stylesheets/drupal/_zen.scss
47
+ - templates/zen/zen-base-rtl.scss
48
+ - templates/zen/zen-base.scss
49
+ - templates/zen/manifest.rb
50
+ has_rdoc: true
51
+ homepage: http://bitbucket.org/barraponto/drupal-compass-extension/
52
+ licenses: []
53
+
54
+ post_install_message:
55
+ rdoc_options: []
56
+
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ requirements: []
76
+
77
+ rubyforge_project:
78
+ rubygems_version: 1.3.7
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: a compass extension providing drupal integration
82
+ test_files: []
83
+