Skip to content

Commit 11e532c

Browse files
committed
Item13267: moving css from NatSkin in here
1 parent 550c6c1 commit 11e532c

File tree

5 files changed

+241
-0
lines changed

5 files changed

+241
-0
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
igp_*
44
*.swp
55
pub/System/GridLayoutPlugin/grid.css
6+
GridLayoutPlugin.md5
7+
GridLayoutPlugin.sha1
8+
GridLayoutPlugin.tgz
9+
GridLayoutPlugin.txt
10+
GridLayoutPlugin.zip
11+
GridLayoutPlugin_installer
12+
GridLayoutPlugin_installer.pl

lib/Foswiki/Plugins/GridLayoutPlugin.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ sub initPlugin {
4343
Foswiki::Func::registerTagHandler('BEGINCOL', sub { return core->BEGINCOL(@_); });
4444
Foswiki::Func::registerTagHandler('ENDCOL', sub { return core->ENDCOL(@_); });
4545

46+
$core = undef;
47+
4648
return 1;
4749
}
4850

-12 KB
Binary file not shown.

lib/Foswiki/Plugins/GridLayoutPlugin/Core.pm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ sub new {
4343
}, $class);
4444

4545
$this->{stack} = [];
46+
$this->{doneCss} = 0;
4647

4748
return $this;
4849
}
@@ -73,11 +74,24 @@ sub currentGrid {
7374
return $grid;
7475
}
7576

77+
sub addCss {
78+
my $this = shift;
79+
80+
return if $this->{doneCss};
81+
$this->{doneCss} = 1;
82+
83+
Foswiki::Func::addToZone('head', 'GRIDLAYOUT', <<HERE);
84+
<link rel='stylesheet' href='%PUBURL%/%SYSTEMWEB%/GridLayoutPlugin/grid.css' media='all' />
85+
HERE
86+
}
87+
7688
sub BEGINGRID {
7789
my ($this, $session, $params, $topic, $web) = @_;
7890

7991
my $result = '';
8092

93+
$this->addCss;
94+
8195
try {
8296
my $grid = new Foswiki::Plugins::GridLayoutPlugin::Grid();
8397
$this->pushGrid($grid);
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
/* grid */
2+
.foswikiGrid:before,
3+
.foswikiGrid:after,
4+
.foswikiRow:after {
5+
clear: both;
6+
content: " ";
7+
display: block;
8+
font-size: 0;
9+
height: 0;
10+
line-height: 0;
11+
visibility: hidden;
12+
}
13+
14+
/* defaults */
15+
.foswikiCol1, .foswikiCol2, .foswikiCol3, .foswikiCol4, .foswikiCol5,
16+
.foswikiCol6, .foswikiCol7, .foswikiCol8, .foswikiCol9, .foswikiCol10,
17+
.foswikiCol11, .foswikiCol12 {
18+
float:left;
19+
height: 100%;
20+
position:relative;
21+
min-height:1em;
22+
}
23+
24+
.foswikiGrid .border {
25+
border-color:#ddd;
26+
border-style:solid;
27+
border-left-width:1px;
28+
}
29+
30+
.foswikiCol12 { width: 100%; }
31+
32+
.foswikiGrid h1,
33+
.foswikiGrid h2,
34+
.foswikiGrid h3,
35+
.foswikiGrid h4,
36+
.foswikiGrid h5,
37+
.foswikiGrid h6 {
38+
/*margin-top:0;*/
39+
}
40+
41+
/* gutter = 0 */
42+
.foswikiGrid.gutter0 .foswikiCol1, .foswikiGrid.gutter0 .foswikiCol2,
43+
.foswikiGrid.gutter0 .foswikiCol3, .foswikiGrid.gutter0 .foswikiCol4,
44+
.foswikiGrid.gutter0 .foswikiCol5, .foswikiGrid.gutter0 .foswikiCol6,
45+
.foswikiGrid.gutter0 .foswikiCol7,.foswikiGrid.gutter0 .foswikiCol8,
46+
.foswikiGrid.gutter0 .foswikiCol9, .foswikiGrid.gutter0 .foswikiCol10,
47+
.foswikiGrid.gutter0 .foswikiCol11 { margin-left:0%; }
48+
.foswikiGrid.gutter0 .border { padding-left: 0; margin-left: -1px; }
49+
.foswikiGrid.gutter0 .foswikiCol1 { width: 8.3333%; }
50+
.foswikiGrid.gutter0 .foswikiCol2 { width: 16.6667%; }
51+
.foswikiGrid.gutter0 .foswikiCol3 { width: 25%; }
52+
.foswikiGrid.gutter0 .foswikiCol4 { width: 33.3333%; }
53+
.foswikiGrid.gutter0 .foswikiCol5 { width: 41.6667%; }
54+
.foswikiGrid.gutter0 .foswikiCol6 { width: 50%; }
55+
.foswikiGrid.gutter0 .foswikiCol7 { width: 58.3333%; }
56+
.foswikiGrid.gutter0 .foswikiCol8 { width: 66.6667%; }
57+
.foswikiGrid.gutter0 .foswikiCol9 { width: 75%; }
58+
.foswikiGrid.gutter0 .foswikiCol10 { width: 83.3333%; }
59+
.foswikiGrid.gutter0 .foswikiCol11 { width: 91.6667%; }
60+
.foswikiGrid.gutter0 hr { margin-bottom:0; margin-top:0; }
61+
.foswikiGrid.gutter0 .foswikiRow { margin-top:0;}
62+
63+
/* gutter = 1 */
64+
.foswikiGrid.gutter1 .foswikiCol1, .foswikiGrid.gutter1 .foswikiCol2,
65+
.foswikiGrid.gutter1 .foswikiCol3, .foswikiGrid.gutter1 .foswikiCol4,
66+
.foswikiGrid.gutter1 .foswikiCol5, .foswikiGrid.gutter1 .foswikiCol6,
67+
.foswikiGrid.gutter1 .foswikiCol7,.foswikiGrid.gutter1 .foswikiCol8,
68+
.foswikiGrid.gutter1 .foswikiCol9, .foswikiGrid.gutter1 .foswikiCol10,
69+
.foswikiGrid.gutter1 .foswikiCol11 { margin-left:1%; }
70+
.foswikiGrid.gutter1 .border { padding-left: 0.4%; margin-left: 0.4%; }
71+
.foswikiGrid.gutter1 .foswikiCol1 { width: 7.4167%; }
72+
.foswikiGrid.gutter1 .foswikiCol2 { width: 15.8333%; }
73+
.foswikiGrid.gutter1 .foswikiCol3 { width: 24.25%; }
74+
.foswikiGrid.gutter1 .foswikiCol4 { width: 32.6667%; }
75+
.foswikiGrid.gutter1 .foswikiCol5 { width: 41.0833%; }
76+
.foswikiGrid.gutter1 .foswikiCol6 { width: 49.5%; }
77+
.foswikiGrid.gutter1 .foswikiCol7 { width: 57.9167%; }
78+
.foswikiGrid.gutter1 .foswikiCol8 { width: 66.3333%; }
79+
.foswikiGrid.gutter1 .foswikiCol9 { width: 74.75%; }
80+
.foswikiGrid.gutter1 .foswikiCol10 { width: 83.1667%; }
81+
.foswikiGrid.gutter1 .foswikiCol11 { width: 91.5833%; }
82+
.foswikiGrid.gutter1 hr { margin-top:0.3462em;margin-bottom:0.3462em;} /* 4.5px */
83+
.foswikiGrid.gutter1 .foswikiRow { margin-top:0.3462em;} /* 4.5px */
84+
85+
/* gutter = 2 */
86+
.foswikiGrid.gutter2 .foswikiCol1, .foswikiGrid.gutter2 .foswikiCol2,
87+
.foswikiGrid.gutter2 .foswikiCol3, .foswikiGrid.gutter2 .foswikiCol4,
88+
.foswikiGrid.gutter2 .foswikiCol5, .foswikiGrid.gutter2 .foswikiCol6,
89+
.foswikiGrid.gutter2 .foswikiCol7,.foswikiGrid.gutter2 .foswikiCol8,
90+
.foswikiGrid.gutter2 .foswikiCol9, .foswikiGrid.gutter2 .foswikiCol10,
91+
.foswikiGrid.gutter2 .foswikiCol11 { margin-left:2%; }
92+
.foswikiGrid.gutter2 .border { padding-left: 0.9%; margin-left: 0.9%; }
93+
.foswikiGrid.gutter2 .foswikiCol1 { width: 6.5%; }
94+
.foswikiGrid.gutter2 .foswikiCol2 { width: 15%; }
95+
.foswikiGrid.gutter2 .foswikiCol3 { width: 23.5%; }
96+
.foswikiGrid.gutter2 .foswikiCol4 { width: 32%; }
97+
.foswikiGrid.gutter2 .foswikiCol5 { width: 40.5%; }
98+
.foswikiGrid.gutter2 .foswikiCol6 { width: 49%; }
99+
.foswikiGrid.gutter2 .foswikiCol7 { width: 57.5%; }
100+
.foswikiGrid.gutter2 .foswikiCol8 { width: 66%; }
101+
.foswikiGrid.gutter2 .foswikiCol9 { width: 74.5%; }
102+
.foswikiGrid.gutter2 .foswikiCol10 { width: 83%; }
103+
.foswikiGrid.gutter2 .foswikiCol11 { width: 91.5%; }
104+
.foswikiGrid.gutter2 hr { margin-top:0.6925em; margin-bottom:0.6925em;} /* 9px */
105+
.foswikiGrid.gutter2 .foswikiRow { margin-top:0.6925em;} /* 9px */
106+
107+
/* gutter = 3 */
108+
.foswikiGrid.gutter3 .foswikiCol1, .foswikiGrid.gutter3 .foswikiCol2,
109+
.foswikiGrid.gutter3 .foswikiCol3, .foswikiGrid.gutter3 .foswikiCol4,
110+
.foswikiGrid.gutter3 .foswikiCol5, .foswikiGrid.gutter3 .foswikiCol6,
111+
.foswikiGrid.gutter3 .foswikiCol7,.foswikiGrid.gutter3 .foswikiCol8,
112+
.foswikiGrid.gutter3 .foswikiCol9, .foswikiGrid.gutter3 .foswikiCol10,
113+
.foswikiGrid.gutter3 .foswikiCol11 { margin-left:3%; }
114+
.foswikiGrid.gutter3 .border { padding-left: 1.4%; margin-left: 1.4%; }
115+
.foswikiGrid.gutter3 .foswikiCol1 { width: 5.5833%; }
116+
.foswikiGrid.gutter3 .foswikiCol2 { width: 14.1667%; }
117+
.foswikiGrid.gutter3 .foswikiCol3 { width: 22.75%; }
118+
.foswikiGrid.gutter3 .foswikiCol4 { width: 31.3333%; }
119+
.foswikiGrid.gutter3 .foswikiCol5 { width: 39.9167%; }
120+
.foswikiGrid.gutter3 .foswikiCol6 { width: 48.5%; }
121+
.foswikiGrid.gutter3 .foswikiCol7 { width: 57.0833%; }
122+
.foswikiGrid.gutter3 .foswikiCol8 { width: 65.6667%; }
123+
.foswikiGrid.gutter3 .foswikiCol9 { width: 74.25%; }
124+
.foswikiGrid.gutter3 .foswikiCol10 { width: 82.8333%; }
125+
.foswikiGrid.gutter3 .foswikiCol11 { width: 91.4167%; }
126+
.foswikiGrid.gutter3 hr { margin-top:1.0384em; margin-bottom:1.0384em;} /* 13.5px */
127+
.foswikiGrid.gutter3 .foswikiRow { margin-top:1.0384em;} /* 13.5px */
128+
129+
/* gutter = 4 */
130+
.foswikiGrid .foswikiCol1, .foswikiGrid .foswikiCol2,
131+
.foswikiGrid .foswikiCol3, .foswikiGrid .foswikiCol4,
132+
.foswikiGrid .foswikiCol5, .foswikiGrid .foswikiCol6,
133+
.foswikiGrid .foswikiCol7,.foswikiGrid .foswikiCol8,
134+
.foswikiGrid .foswikiCol9, .foswikiGrid .foswikiCol10,
135+
.foswikiGrid .foswikiCol11 { margin-left:4%; }
136+
.foswikiGrid .border { padding-left: 1.9%; margin-left: 1.9%; }
137+
.foswikiGrid .foswikiCol1 { width: 4.6667%; }
138+
.foswikiGrid .foswikiCol2 { width: 13.3333%; }
139+
.foswikiGrid .foswikiCol3 { width: 22%; }
140+
.foswikiGrid .foswikiCol4 { width: 30.6667%; }
141+
.foswikiGrid .foswikiCol5 { width: 39.3333%; }
142+
.foswikiGrid .foswikiCol6 { width: 48%; }
143+
.foswikiGrid .foswikiCol7 { width: 56.6667%; }
144+
.foswikiGrid .foswikiCol8 { width: 65.3333%; }
145+
.foswikiGrid .foswikiCol9 { width: 74%; }
146+
.foswikiGrid .foswikiCol10 { width: 82.6667%; }
147+
.foswikiGrid .foswikiCol11 { width: 91.3333%; }
148+
.foswikiRow { margin-top:1.385em; } /* 18px */
149+
150+
/* gutter = 5 */
151+
.foswikiGrid.gutter5 .foswikiCol1, .foswikiGrid.gutter5 .foswikiCol2,
152+
.foswikiGrid.gutter5 .foswikiCol3, .foswikiGrid.gutter5 .foswikiCol4,
153+
.foswikiGrid.gutter5 .foswikiCol5, .foswikiGrid.gutter5 .foswikiCol6,
154+
.foswikiGrid.gutter5 .foswikiCol7,.foswikiGrid.gutter5 .foswikiCol8,
155+
.foswikiGrid.gutter5 .foswikiCol9, .foswikiGrid.gutter5 .foswikiCol10,
156+
.foswikiGrid.gutter5 .foswikiCol11 { margin-left:5%; }
157+
.foswikiGrid.gutter5 .border { padding-left: 2.4%; margin-left: 2.4%; }
158+
.foswikiGrid.gutter5 .foswikiCol1 { width: 3.75%; }
159+
.foswikiGrid.gutter5 .foswikiCol2 { width: 12.5%; }
160+
.foswikiGrid.gutter5 .foswikiCol3 { width: 21.25%; }
161+
.foswikiGrid.gutter5 .foswikiCol4 { width: 30%; }
162+
.foswikiGrid.gutter5 .foswikiCol5 { width: 38.75%; }
163+
.foswikiGrid.gutter5 .foswikiCol6 { width: 47.5%; }
164+
.foswikiGrid.gutter5 .foswikiCol7 { width: 56.25%; }
165+
.foswikiGrid.gutter5 .foswikiCol8 { width: 65%; }
166+
.foswikiGrid.gutter5 .foswikiCol9 { width: 73.75%; }
167+
.foswikiGrid.gutter5 .foswikiCol10 { width: 82.5%; }
168+
.foswikiGrid.gutter5 .foswikiCol11 { width: 91.25%; }
169+
.foswikiGrid.gutter5 hr { margin-top:1.7307em; margin-bottom:1.7307em; } /* 22.5px */
170+
.foswikiGrid.gutter5 .foswikiRow { margin-top:1.7307em; } /* 22.5px */
171+
172+
.foswikiRow:first-child {
173+
margin-top:0px !important;
174+
}
175+
.foswikiGrid .foswikiCol1:first-child,
176+
.foswikiGrid .foswikiCol2:first-child,
177+
.foswikiGrid .foswikiCol3:first-child,
178+
.foswikiGrid .foswikiCol4:first-child,
179+
.foswikiGrid .foswikiCol5:first-child,
180+
.foswikiGrid .foswikiCol6:first-child,
181+
.foswikiGrid .foswikiCol7:first-child,
182+
.foswikiGrid .foswikiCol8:first-child,
183+
.foswikiGrid .foswikiCol9:first-child,
184+
.foswikiGrid .foswikiCol10:first-child,
185+
.foswikiGrid .foswikiCol11:first-child,
186+
.foswikiGrid .foswikiCol12:first-child {
187+
margin-top:0 !important;
188+
margin-left:0 !important;
189+
border:0 !important;
190+
padding-left:0 !important;
191+
}
192+
193+
194+
@media (max-width: 600px) {
195+
.foswikiGrid .foswikiCol1,
196+
.foswikiGrid .foswikiCol2,
197+
.foswikiGrid .foswikiCol3,
198+
.foswikiGrid .foswikiCol4,
199+
.foswikiGrid .foswikiCol5,
200+
.foswikiGrid .foswikiCol6,
201+
.foswikiGrid .foswikiCol7,
202+
.foswikiGrid .foswikiCol8,
203+
.foswikiGrid .foswikiCol9,
204+
.foswikiGrid .foswikiCol10,
205+
.foswikiGrid .foswikiCol11,
206+
.foswikiGrid .foswikiCol12 {
207+
float:none;
208+
width:100%;
209+
padding-left:0;
210+
min-height:0;
211+
margin:1.385em 0 0 0;
212+
}
213+
.foswikiGrid .border {
214+
border-left-width:0;
215+
border-top-width:1px;
216+
padding-top:1.385em;
217+
}
218+
}

0 commit comments

Comments
 (0)