Skip to content

Commit

Permalink
Add mobile and tablet styles
Browse files Browse the repository at this point in the history
Closes luckyframework#43

This commit makes minimal changes to the existing styles and as few
changes as possible to the existing markup to add responsive views into
the guides.
  • Loading branch information
sch committed Oct 14, 2018
1 parent db5a5d8 commit 1accadb
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 37 deletions.
2 changes: 1 addition & 1 deletion source/assets/stylesheets/_btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
background: $medium-green;
text-transform: uppercase;
font-weight: bold;
height: $btn-height;
min-height: $btn-height;
font-size: 14px;
color: #fff;
padding: 15px 30px;
Expand Down
23 changes: 19 additions & 4 deletions source/assets/stylesheets/_header-nav.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
.header-nav {
display: flex;
flex-direction: row;
@include medium-up {
display: flex;
align-items: center;
}

li {
margin-left: 35px;
@include medium-up {
li {
margin-left: 35px;
}
}

a {
Expand All @@ -14,9 +18,20 @@
letter-spacing: 1.5px;
text-decoration: none;
text-transform: uppercase;
padding-top: 10px;
padding-bottom: 8px;

@include medium-up {
padding-top: 26px;
padding-bottom: 24px;
}

&:hover {
text-decoration: underline;
}
}

.github-button-item {
padding: 10px 0;
}
}
12 changes: 7 additions & 5 deletions source/assets/stylesheets/_header.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
.header {
background: #002748;
background-image: linear-gradient(90deg, #021E37 0%, #023B6C 100%);
height: 70px;
padding-top: 20px;
padding-bottom: 20px;

&__container {
@include centered-container;
display: flex;
justify-content: space-between;
align-items: center;
height: 100%;
@include medium-up {
display: flex;
justify-content: space-between;
align-items: center;
}
}

&__logo {
Expand Down
5 changes: 4 additions & 1 deletion source/assets/stylesheets/_intro-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ $intro-card-padding: 38px;
border-radius: 8px;
padding: 20px 0;
box-sizing: border-box;
width: $intro-card-width;

@include large-up {
width: $intro-card-width;
}

&__heading {
text-transform: uppercase;
Expand Down
47 changes: 32 additions & 15 deletions source/assets/stylesheets/_page-intro.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
background-image: linear-gradient(130deg, #00a7c1 0%, #25dcad 100%);
color: #fff;

.intro-card {
position: absolute;
top: 20px;
left: 10px;
@include large-up {
.intro-card {
position: absolute;
top: 20px;
left: 10px;
}
}

&__container {
@include centered-container;
@include padding(60px null);
position: relative;
display: flex;
flex-direction: row;
}

@include large-up {
&__container {
display: flex;
}
}

&__arrow {
Expand All @@ -28,7 +34,10 @@
text-shadow: 0 1px 2px rgba(20, 120, 102, 0.27);
font-weight: bold;
text-transform: uppercase;
float: left;

@include large-up {
float: left;
}

a {
color: #fff;
Expand All @@ -41,20 +50,28 @@
}
}

&__left {
display: flex;
flex-direction: column;
margin-left: $intro-card-width + 30px;

@include large-up {
&__left {
display: flex;
flex-direction: column;
margin-left: $intro-card-width + 30px;
}
}

&__toc {
font-size: 18px;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.39);
padding: 10px 75px 0 0;

&--wide {
column-count: 2;
break-inside: avoid;
padding: 20px 0;

@include medium-up {
padding: 10px 75px 30px 0;

&--wide {
column-count: 2;
break-inside: avoid;
}
}
}

Expand Down
32 changes: 24 additions & 8 deletions source/assets/stylesheets/_text-container.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
.text-container {
@include centered-container;
margin: 30px auto;
max-width: 40em;
color: $dark-navy;
font-size: 16px;
padding-bottom: 40px;
word-wrap: break-word;
font-size: 12px;

#next-page-link {
margin: 15px 0;
@include medium-up {
font-size: 14px;
}

@include large-up {
font-size: 16px;
@include centered-container;

&--with-table-of-contents {
padding-left: $intro-card-width + 60px;
}
}

&--with-table-of-contents {
padding-left: $intro-card-width + 60px;
#next-page-link {
margin: 15px 0;
}

h1,
Expand Down Expand Up @@ -56,7 +67,6 @@
}

code {
font-size: 16px;
font-family: Menlo, Roboto Mono, Courier New, monospace;
background: #fff;
border-radius: 4px;
Expand All @@ -72,11 +82,17 @@
blockquote {
background: #ffffff;
border-radius: 4px;
padding: 10px 10px 10px 16px;
margin: 30px 0 30px -16px;
margin: 30px -16px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

pre > code {
padding-left: 16px;
padding-right: 16px;
padding-top: 10px;
padding-bottom: 10px;
}

blockquote {
border-left: 2px solid $medium-green;
color: $medium-gray;
Expand Down
4 changes: 4 additions & 0 deletions source/assets/stylesheets/main.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ body {
font-family: "Lato", sans-serif;
}

main {
overflow: hidden;
}

.light-body {
background: #f4f7f6;
}
9 changes: 7 additions & 2 deletions source/assets/stylesheets/mixins/_centered-container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
margin-left: auto;
margin-right: auto;
box-sizing: border-box;
padding-left: 24px;
padding-right: 24px;
padding-left: 12px;
padding-right: 12px;

@include medium-up {
padding-left: 24px;
padding-right: 24px;
}
}
2 changes: 1 addition & 1 deletion source/partials/_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<li>
<a href="https://github.com/luckyframework/web">GitHub</a>
</li>
<li>
<li class="github-button-item">
<a class="github-button" href="https://github.com/luckyframework/web" data-size="large" data-show-count="true" aria-label="Star luckyframework/web on GitHub">Star</a>
</li>
<li>
Expand Down
1 change: 1 addition & 0 deletions source/partials/_layout_head.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<head>
<meta charset="utf-8">
<title><%= title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link rel="stylesheet"
Expand Down

0 comments on commit 1accadb

Please sign in to comment.