<button class="button">
<span class="button__text button__text--on">ON</span>
<span class="button__text button__text--off">OFF</span>
</button>
<div class="site-wrapper">
<!-- Шапка сайта -->
<header class="site-header">
<h1 class="site-header__title">Название сайта</h1>
<nav class="site-header__nav site-nav">
<a href="#" class="site-nav__link">О продукте</a>
<a href="#" class="site-nav__link">О погоде</a>
<a href="#" class="site-nav__link">О чём шумит камыш</a>
</nav>
</header>
<!-- Главное содержимое страницы -->
<main class="site-main">
<!-- Разделы главного содержимого -->
<section class="features">
<h2 class="features__title">Преимущества</h2>
<ul class="features__list">
<li class="features__item">Высокие потолки</li>
<li class="features__item">[...]</li>
</ul>
</section>
<section class="prices">
<h2 class="prices__title">Тарифы</h2>
<ul class="prices__list">
<li class="prices__item">30 зонтиков в минуту</li>
<li class="prices__item">[...]</li>
</ul>
</section>
</main>
<!-- Боковая колонка -->
<aside class="site-aside">
<div class="widget">
<h3 class="widget__title">Как мы отдыхаем?</h3>
<div class="widget__text">Читайте в нашей новой книге «Никак»</div>
</div>
</aside>
<!-- Подвал сайта -->
<footer class="site-footer">
<ul class="site-footer__socials socials">
<li class="socials__item">
<a href="#" class="socials__link">Switter</a>
</li>
<li class="socials__item">
<a href="#" class="socials__link">Facebook</a>
</li>
<li class="socials__item">
<a href="#" class="socials__link">Одноглазники</a>
</li>
</ul>
<div class="site-footer__copyright copyright ">
Сделано <a href="#" class="copyright__link">левой пяткой</a>
</div>
</footer>
</div>
BODY.outlines-on > * {
outline: 2px solid deeppink;
}
BODY.outlines-on > * > * {
outline: 2px dashed lime;
outline-offset: -2px;
}
BODY.outlines-on > * > * > * {
outline: 2px dotted dodgerblue;
outline-offset: -4px;
}
/* Button
-------------------- */
.button {
position: absolute;
top: 0;
right: 2rem;
min-width: 110px;
outline: 0;
padding: .75rem 1rem;
box-sizing: border-box;
background: #BBB;
background-image: linear-gradient(
hsla(0,0%,60%,.5) 1px,
hsla(0,0%,60%,0) 1px);
background-size: .3rem .3rem;
border: 0;
box-shadow: 0 0 0 3px #AAA,
0 3px 12px #000;
border-radius: 0 0 5px 5px;
outline: 0 !important;
cursor: pointer;
font-size: 18px;
text-shadow: 1px 0 2px hsl(0,0%,87%),
-1px 0 2px hsl(0,0%,87%),
0 -1px 2px hsl(0,0%,87%),
0 1px 2px hsl(0,0%,87%);
text-align: left;
&:before {
content: '';
display: inline-block;
width: 1.5rem;
height: 1.5rem;
margin-right: .2rem;
border-radius: 5px;
box-shadow: 0 0 0 3px #999,
0 -2px 7px hsla(0,0%,10%, 1) inset;
background: #555;
vertical-align: middle;
}
&__text {
vertical-align: bottom;
outline: 0 !important;
font-weight: bold;
}
}
.button__text--off {
color: #444;
}
.button__text--on {
display: none;
color: #777;
text-shadow: 1px 1px 2px white,
-1px 1px 2px white;
}
.state-on {
background-color: #DDD;
background-image: linear-gradient(
hsla(0,0%,70%,.5) 1px,
hsla(0,0%,70%,0) 1px);
box-shadow: 0 0 0 3px #CCC,
0 3px 12px #000;
&:before {
box-shadow:
0 0 15px 3px greenyellow,
0 0 0 3px #BBB,
0 0 1px 2px hsla(150,0%,97%, 1),
0 -2px 7px hsla(200,90%,90%, 1) inset,
0 2px 7px hsla(80,50%,40%, 1) inset;
background: greenyellow;
}
.button__text--on {
display: inline-block;
}
.button__text--off {
display: none;
}
}
/* Layout
------------------------------ */
HTML {
height: 100%;
}
BODY {
display: flex;
justify-content: space-around;
align-items: center;
min-height: 100%;
font: 12px/1.4 Arial, sans-serif;
}
A {
color: steelblue;
}
H1 {
font-size: 3rem;
}
H2 {
margin-bottom: .5em;
font-size: 2rem;
}
H3 {
margin-bottom: .5em;
font-size: 1.3rem;
}
LI:before {
content: '— ';
}
.site-wrapper {
width: 75vw;
min-width: 320px;
display: flex;
flex-wrap: wrap;
padding: .5rem;
}
/* Header
-------------------- */
.site-header {
width: 100%;
margin-bottom: 1rem;
padding: .5rem 1.5rem;
}
.site-header__title {
margin-bottom: 1rem;
padding: .5rem 1rem;
}
.site-header__nav {
display: flex;
justify-content: space-between;
padding: .5rem 1rem;;
}
/* Main
-------------------- */
.site-main {
flex-grow: 1;
padding: 1rem 1.5rem;
}
.features,
.prices {
padding: .5rem 1rem;
}
/* Aside
-------------------- */
.site-aside {
display: none;
width: 25vw;
margin-left: .5rem;
padding: 1rem;
@media ( min-width: 600px ) {
display: block;
}
}
.widget {
padding: .5rem;
}
/* Footer
-------------------- */
.site-footer {
width: 100%;
margin-top: 1rem;
padding: .5rem 1.5rem;
display: flex;
justify-content: space-between;
}
.socials {
width: 50%;
padding: .5rem 1rem;
@media ( min-width: 600px ) {
display: flex;
justify-content: space-between;
}
}
.socials__item:before {
content: none;
}
.copyright {
padding: .5rem 1rem;
}
View Compiled
var button = document.querySelector('.button');
setClasses();
button.onclick = function () {
setClasses();
}
function setClasses() {
document.body.classList.toggle('outlines-on');
button.classList.toggle('state-on');
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.