Skip to content

Commit e729f74

Browse files
bring container margin top into variable and reduce it on mobile
1 parent 17fe360 commit e729f74

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

style/main.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,8 @@ hr {
480480

481481
.game-intro {
482482
float: left;
483-
line-height: 42px; }
483+
line-height: 42px;
484+
margin-bottom: 0; }
484485

485486
.restart-button {
486487
display: inline-block;
@@ -536,7 +537,7 @@ hr {
536537
margin-top: 2px; }
537538

538539
.game-container {
539-
margin-top: 40px;
540+
margin-top: 10px;
540541
position: relative;
541542
padding: 10px;
542543
cursor: default;
@@ -692,9 +693,6 @@ hr {
692693
-moz-transform: translate(202px, 202px);
693694
transform: translate(202px, 202px); }
694695

695-
.game-container {
696-
margin-top: 20px; }
697-
698696
.tile .tile-inner {
699697
font-size: 35px; }
700698

style/main.scss

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $tile-color: #eee4da;
1616
$tile-gold-color: #edc22e;
1717
$tile-gold-glow-color: lighten($tile-gold-color, 15%);
1818

19+
$game-container-margin-top: 40px;
1920
$game-container-background: #bbada0;
2021

2122
$transition-speed: 100ms;
@@ -169,7 +170,7 @@ hr {
169170
// Game field mixin used to render CSS at different width
170171
@mixin game-field {
171172
.game-container {
172-
margin-top: 40px;
173+
margin-top: $game-container-margin-top;
173174
position: relative;
174175
padding: $grid-spacing;
175176

@@ -447,20 +448,17 @@ hr {
447448

448449
.above-game {
449450
@include clearfix;
450-
// margin-bottom: 10px;
451451
}
452452

453453
.game-intro {
454454
float: left;
455455
line-height: 42px;
456-
// margin-bottom: 0;
456+
margin-bottom: 0;
457457
}
458458

459459
.restart-button {
460460
@include button;
461461
display: block;
462-
// width: 100px;
463-
// margin: 10px auto 10px auto;
464462
text-align: center;
465463
float: right;
466464
}
@@ -476,6 +474,7 @@ hr {
476474
$grid-row-cells: 4;
477475
$tile-size: ($field-width - $grid-spacing * ($grid-row-cells + 1)) / $grid-row-cells;
478476
$tile-border-radius: 3px;
477+
$game-container-margin-top: 10px;
479478

480479
html, body {
481480
font-size: 15px;
@@ -525,10 +524,6 @@ hr {
525524
// Render the game field at the right width
526525
@include game-field;
527526

528-
.game-container {
529-
margin-top: 20px;
530-
}
531-
532527
// Rest of the font-size adjustments in the tile class
533528
.tile .tile-inner {
534529
font-size: 35px;

0 commit comments

Comments
 (0)