Improve back button appearance
This commit is contained in:
parent
6abfb81975
commit
b9b3dbbd9b
|
@ -1,8 +1,10 @@
|
|||
<nav class='top-nav'>
|
||||
<div class='container'>
|
||||
{% unless include.is_home %}
|
||||
<div class='left'>
|
||||
<a class='home' href='{{base}}'></a>
|
||||
<a class='home back-button' href='{{base}}'></a>
|
||||
</div>
|
||||
{% endunless %}
|
||||
|
||||
<a class='brand' href='{{base}}'>
|
||||
Rico's cheatsheets
|
||||
|
|
|
@ -9,7 +9,7 @@ type: website
|
|||
| sort: "updated", "first"
|
||||
%}
|
||||
{% include 2017/head.html %}
|
||||
{% include 2017/top-nav.html page=page %}
|
||||
{% include 2017/top-nav.html page=page is_home=true %}
|
||||
|
||||
<div class='SideAd'>
|
||||
<script async src='//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom' id="_carbonads_js"></script>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Home link
|
||||
*/
|
||||
|
||||
.back-button {
|
||||
text-decoration: none;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
line-height: 48px - 2px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
border-radius: 50%;
|
||||
transition: all 100ms linear;
|
||||
|
||||
// Smaller on mobile
|
||||
@media (max-width: 480px) {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px - 2;
|
||||
}
|
||||
|
||||
// Colors
|
||||
&,
|
||||
&:visited {
|
||||
color: $base-mute;
|
||||
}
|
||||
|
||||
// Active
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: white;
|
||||
background: $base-a;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
// Icon
|
||||
&::before {
|
||||
@include ion-icon('md-arrow-back');
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
// Icon: smaller on mobile
|
||||
@media (max-width: 480px) {
|
||||
&::before {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
// Clearfix
|
||||
& > div > span::after {
|
||||
content: '';
|
||||
display: table;
|
||||
|
@ -49,6 +50,7 @@
|
|||
margin-bottom: -0.02em;
|
||||
}
|
||||
|
||||
@media (min-width: 481px) {
|
||||
.carbon-poweredby::before {
|
||||
display: block;
|
||||
content: '';
|
||||
|
@ -58,3 +60,4 @@
|
|||
margin: 8px (130px + 16px) 8px auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,10 +48,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Mobile: reorder things
|
||||
@media (max-width: 540px) {
|
||||
& {
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
& > h1,
|
||||
|
|
|
@ -1,12 +1,30 @@
|
|||
.top-nav {
|
||||
& {
|
||||
&,
|
||||
& > .container {
|
||||
height: 64px;
|
||||
line-height: 64px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
// Smaller on mobile
|
||||
@media (max-width: 480px) {
|
||||
& > .container {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
& {
|
||||
height: 32px + 8px + 8px;
|
||||
padding: 8px 0;
|
||||
border-bottom: solid 1px $dark-line-color;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
// Horiz line
|
||||
@media (min-width: 481px) {
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
|
@ -15,15 +33,20 @@
|
|||
right: 40%;
|
||||
bottom: 0;
|
||||
height: 1px;
|
||||
background: $dark-line-color;
|
||||
background: linear-gradient(to right,
|
||||
transparent,
|
||||
$dark-line-color 20%,
|
||||
$dark-line-color 80%,
|
||||
transparent);
|
||||
|
||||
@media (max-width: 480px) {
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .container {
|
||||
& > .container {
|
||||
@include gutter(padding-left);
|
||||
@include gutter(padding-right);
|
||||
max-width: $area-width;
|
||||
|
@ -70,6 +93,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Mobile
|
||||
@media (max-width: 480px) {
|
||||
& > .brand {
|
||||
display: none;
|
||||
}
|
||||
|
||||
& > .actions {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// Desktop: absolute the actions
|
||||
@media (min-width: 481px) {
|
||||
& > .actions {
|
||||
position: absolute;
|
||||
|
@ -84,23 +119,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
// Home link
|
||||
// Offset so it doesn't look misasligned
|
||||
& > .left > .home {
|
||||
text-decoration: none;
|
||||
|
||||
&,
|
||||
&:visited {
|
||||
color: $base-mute;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $base-a;
|
||||
}
|
||||
}
|
||||
|
||||
& > .left > .home::before {
|
||||
@include ion-icon('md-arrow-back');
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
left: -16px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
@import './markdown/table';
|
||||
@import './markdown/ul';
|
||||
@import './components/attribute-peg';
|
||||
@import './components/back-button';
|
||||
@import './components/body-area';
|
||||
@import './components/h2-section';
|
||||
@import './components/h3-section';
|
||||
|
|
Loading…
Reference in New Issue