Skip to content

Commit 166d9ed

Browse files
committed
Added Workaround.scss
Issues #36
1 parent b5e938a commit 166d9ed

File tree

10 files changed

+1612
-58
lines changed

10 files changed

+1612
-58
lines changed

src/main/java/com/jarektoro/responsivelayout/ResponsiveLayout.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public void setScrollable(boolean scrollable) {
6161
removeStyleName(CSS_CONTAINER_SCROLLABLE);
6262
}
6363
}
64-
64+
6565
public ResponsiveLayout withStyleName(String styleName) {
66-
addStyleName(styleName);
67-
return this;
66+
addStyleName(styleName);
67+
return this;
6868
}
6969

7070
/**

src/main/resources/com/jarektoro/responsivelayout/_alignment.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import "vars";
12
@mixin alignment {
23

34
&-start-xs {
@@ -62,7 +63,7 @@
6263
order: 1;
6364
}
6465

65-
@media only screen and (min-width: 48em) {
66+
@media only screen and (min-width: $sm-breakpoint) {
6667

6768
&-start-sm {
6869
-ms-flex-pack: start;
@@ -118,7 +119,7 @@
118119
}
119120
}
120121

121-
@media only screen and (min-width: 62em) {
122+
@media only screen and (min-width: $md-breakpoint) {
122123

123124
&-start-md {
124125
-ms-flex-pack: start;
@@ -174,7 +175,7 @@
174175
}
175176
}
176177

177-
@media only screen and (min-width: 75em) {
178+
@media only screen and (min-width: $lg-breakpoint) {
178179

179180
&-start-lg {
180181
-ms-flex-pack: start;

src/main/resources/com/jarektoro/responsivelayout/_col.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
@import "vars";
2+
3+
14
@mixin col {
25

6+
$special_value:77775555px;
7+
8+
39
&-col {
410

511
.col-container {
@@ -163,7 +169,7 @@
163169
margin-left: 91.667%;
164170
}
165171

166-
@media only screen and (min-width: 48em) {
172+
@media only screen and (min-width: $sm-breakpoint) {
167173
&-sm, &-sm-1, &-sm-2, &-sm-3, &-sm-4, &-sm-5, &-sm-6, &-sm-7, &-sm-8, &-sm-9, &-sm-10, &-sm-11, &-sm-12 {
168174
box-sizing: border-box;
169175
-ms-flex: 0 0 auto;
@@ -274,7 +280,7 @@
274280
}
275281
}
276282

277-
@media only screen and (min-width: 62em) {
283+
@media only screen and (min-width: $md-breakpoint) {
278284

279285
&-md, &-md-1, &-md-2, &-md-3, &-md-4, &-md-5, &-md-6, &-md-7, &-md-8, &-md-9, &-md-10, &-md-11, &-md-12 {
280286
box-sizing: border-box;
@@ -389,7 +395,7 @@
389395

390396
}
391397

392-
@media only screen and (min-width: 75em) {
398+
@media only screen and (min-width: $lg-breakpoint) {
393399
&-lg, &-lg-1, &-lg-2, &-lg-3, &-lg-4, &-lg-5, &-lg-6, &-lg-7, &-lg-8, &-lg-9, &-lg-10, &-lg-11, &-lg-12 {
394400
box-sizing: border-box;
395401
-ms-flex: 0 0 auto;

src/main/resources/com/jarektoro/responsivelayout/_container.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "vars";
2+
13
@mixin container {
24

35
&-container {
@@ -13,19 +15,19 @@
1315
width: 100%;
1416
}
1517

16-
@media only screen and (min-width: 48em) {
18+
@media only screen and (min-width: $sm-breakpoint) {
1719
&-fixed {
1820
width: 46rem;
1921
}
2022
}
2123

22-
@media only screen and (min-width: 62em) {
24+
@media only screen and (min-width: $md-breakpoint) {
2325
&-fixed {
2426
width: 61rem;
2527
}
2628
}
2729

28-
@media only screen and (min-width: 75em) {
30+
@media only screen and (min-width: $lg-breakpoint) {
2931
&-fixed {
3032
width: 71rem;
3133
}

src/main/resources/com/jarektoro/responsivelayout/_row.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import "vars";
12
@mixin row {
23

34
&-row {
@@ -98,7 +99,7 @@
9899
padding-bottom: .3rem;
99100
}
100101
@media only screen and (max-width: 47em) {
101-
102+
//needs to be one less then md-breakpoint
102103
&.margin-xs {
103104
margin: 2rem !important;
104105

@@ -140,7 +141,7 @@
140141
}
141142
}
142143

143-
@media only screen and (min-width: 48em) {
144+
@media only screen and (min-width: $sm-breakpoint) {
144145
//SM
145146
&.margin-sm {
146147
margin: 2rem !important;
@@ -184,7 +185,7 @@
184185

185186
}
186187

187-
@media only screen and (min-width: 62em) {
188+
@media only screen and (min-width: $md-breakpoint) {
188189
//MD
189190
&.margin-md {
190191
margin: 2rem !important;
@@ -227,7 +228,7 @@
227228
}
228229
}
229230

230-
@media only screen and (min-width: 75em) {
231+
@media only screen and (min-width: $lg-breakpoint) {
231232
//LG
232233
&.margin-lg {
233234
margin: 2rem !important;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//$xs-max-width: 12345px;
2+
$sm-breakpoint: 23456px; // 48em default
3+
$md-breakpoint: 34567px; // 62em default
4+
$lg-breakpoint: 45678px; // 75em default

src/main/resources/com/jarektoro/responsivelayout/_visibility.scss

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
@import "vars";
12
@mixin visibility {
23

34
&-visible-xs, &-visible-sm, &-visible-md, &-visible-lg, &-visible-xs-block, &-visible-xs-inline, &-visible-xs-inline-block, &-visible-sm-block, &-visible-sm-inline, &-visible-sm-inline-block, &-visible-md-block, &-visible-md-inline, &-visible-md-inline-block, &-visible-lg-block, &-visible-lg-inline, &-visible-lg-inline-block {
45
display: none !important;
56
}
67

78
@media (max-width: 767px) {
9+
// one less then md-breakpoint
810
&-visible-xs {
911
display: block !important;
1012
&.col.col-content-center {
@@ -23,24 +25,31 @@
2325
}
2426

2527
@media (max-width: 767px) {
28+
// one less then md-breakpoint
29+
2630
&-visible-xs-block {
2731
display: block !important;
2832
}
2933
}
3034

3135
@media (max-width: 767px) {
36+
// one less then md-breakpoint
37+
3238
&-visible-xs-inline {
3339
display: inline !important;
3440
}
3541
}
3642

3743
@media (max-width: 767px) {
44+
// one less then md-breakpoint
45+
3846
&-visible-xs-inline-block {
3947
display: inline-block !important;
4048
}
4149
}
4250

43-
@media (min-width: 768px) and (max-width: 991px) {
51+
@media (min-width: $sm-breakpoint) and (max-width: 991px) {
52+
// one less then md-breakpoint
4453
&-visible-sm {
4554
display: block !important;
4655
&.col.col-content-center {
@@ -58,25 +67,33 @@
5867
}
5968
}
6069

61-
@media (min-width: 768px) and (max-width: 991px) {
70+
@media (min-width: $sm-breakpoint) and (max-width: 991px) {
71+
// one less then md-breakpoint
72+
6273
&-visible-sm-block {
6374
display: block !important;
6475
}
6576
}
6677

67-
@media (min-width: 768px) and (max-width: 991px) {
78+
@media (min-width: $sm-breakpoint) and (max-width: 991px) {
79+
// one less then md-breakpoint
80+
6881
&-visible-sm-inline {
6982
display: inline !important;
7083
}
7184
}
7285

73-
@media (min-width: 768px) and (max-width: 991px) {
86+
@media (min-width: $sm-breakpoint) and (max-width: 991px) {
87+
// one less then md-breakpoint
88+
7489
&-visible-sm-inline-block {
7590
display: inline-block !important;
7691
}
7792
}
7893

79-
@media (min-width: 992px) and (max-width: 1199px) {
94+
@media (min-width: $md-breakpoint) and (max-width: 1199px) {
95+
// one less then lg-breakpoint
96+
8097
&-visible-md {
8198
display: block !important;
8299
&.col.col-content-center {
@@ -94,25 +111,31 @@
94111
}
95112
}
96113

97-
@media (min-width: 992px) and (max-width: 1199px) {
114+
@media (min-width: $md-breakpoint) and (max-width: 1199px) {
115+
// one less then lg-breakpoint
116+
98117
&-visible-md-block {
99118
display: block !important;
100119
}
101120
}
102121

103-
@media (min-width: 992px) and (max-width: 1199px) {
122+
@media (min-width: $md-breakpoint) and (max-width: 1199px) {
123+
// one less then lg-breakpoint
124+
104125
&-visible-md-inline {
105126
display: inline !important;
106127
}
107128
}
108129

109-
@media (min-width: 992px) and (max-width: 1199px) {
130+
@media (min-width: $md-breakpoint) and (max-width: 1199px) {
131+
// one less then lg-breakpoint
132+
110133
&-visible-md-inline-block {
111134
display: inline-block !important;
112135
}
113136
}
114137

115-
@media (min-width: 1200px) {
138+
@media (min-width: $lg-breakpoint) {
116139
&-visible-lg {
117140
display: block !important;
118141
&.col.col-content-center {
@@ -130,43 +153,48 @@
130153
}
131154
}
132155

133-
@media (min-width: 1200px) {
156+
@media (min-width: $lg-breakpoint) {
134157
&-visible-lg-block {
135158
display: block !important;
136159
}
137160
}
138161

139-
@media (min-width: 1200px) {
162+
@media (min-width: $lg-breakpoint) {
140163
&-visible-lg-inline {
141164
display: inline !important;
142165
}
143166
}
144167

145-
@media (min-width: 1200px) {
168+
@media (min-width: $lg-breakpoint) {
146169
&-visible-lg-inline-block {
147170
display: inline-block !important;
148171
}
149172
}
150173

151174
@media (max-width: 767px) {
175+
// one less then sm-breakpoint
152176
&-hidden-xs {
153177
display: none !important;
154178
}
155179
}
156180

157-
@media (min-width: 768px) and (max-width: 991px) {
181+
@media (min-width: $sm-breakpoint) and (max-width: 991px) {
182+
// one less then md-breakpoint
183+
158184
&-hidden-sm {
159185
display: none !important;
160186
}
161187
}
162188

163-
@media (min-width: 992px) and (max-width: 1199px) {
189+
@media (min-width: $md-breakpoint) and (max-width: 1199px) {
190+
// one less then lg-breakpoint
191+
164192
&-hidden-md {
165193
display: none !important;
166194
}
167195
}
168196

169-
@media (min-width: 1200px) {
197+
@media (min-width: $lg-breakpoint) {
170198
&-hidden-lg {
171199
display: none !important;
172200
}

0 commit comments

Comments
 (0)