Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
@extend .foo, .bar. width: 186rem; margin: 20rem auto;? По умолчанию 1rem = 16px.<button>, будут дефолтные бордеры.transition:all .3s ease; можно заменить на transition: .3s ease;, но если вы меняете только одно свойство, то лучше указать его явно transition: background-color .3s ease; чтобы избежать ненужных анимаций.button до butt странно, коллеги не поймут (butt — анг. задница), общепринято btn.вместо табуляции используйте 4 пробела, оступы огромные
<a href="#" class="btn btn-blue">Инфраструктура</a>
<a href="#" class="btn btn-red">Квартиры</a>
<a href="#" class="btn btn-yellow">Галерея</a>
<a href="#" class="btn btn-transparent">Архив новостей</a>
<a href="#" class="btn btn-transparent btn-xl">Показать все новости</a>
.btn {
display: block;
height: 50px;
line-height: 50px;
text-align: center;
font-family: 'intro';
font-size: 12px;
text-decoration: none;
background: transparent;
transition: background .3s ease;
&.btn-blue {
background-color: #80B1D3;
&:hover {
background: #80B1D3;
color: #fff;
}
}
&.btn-red {
background-color: #D46C6B;
&:hover {
background: #D46C6B;
color: #fff;
}
}
&.btn-yellow {
background-color: #F3B562;
&:hover {
background: #D46C6B;
color: #fff;
}
}
&.btn-transparent {
box-shadow: inset 0 0 0 2rem $gray_4;
}
&.btn-xl {
height: 70px;
line-height: 70px;
font-size: 16px;
}
}
.about_butt {
display: block;
height:50px;
line-height: 50px;
text-align: center;
font-family: 'intro';
font-size: 12px;
&.blue_mod {
background: $blue_1;
color: $white;
transition: all .3s ease;
&:hover, &:focus {
text-decoration: none;
}
&:hover {
background: lighten($blue_1, 5%);
}
}
&.red_mod {
background: $red_2;
color: $white;
transition: all .3s ease;
&:hover, &:focus {
text-decoration: none;
}
&:hover {
background: lighten($red_2, 5%);
}
}
&.yellow_mod {
background: $yellow_1;
color: $white;
transition: all .3s ease;
&:hover, &:focus {
text-decoration: none;
}
&:hover {
background: lighten($yellow_1, 5%);
}
}
}
.news_more_butt {
display: block;
height:50px;
line-height: 50px;
text-align: center;
font-family: 'intro';
font-size: 12px;
color: $black_2;
background: transparent;
box-shadow: inset 0 0 0 2rem $gray_4;
transition: all .3s ease;
width: 186px;
margin: 20px auto;
&:hover, &:focus {
text-decoration: none;
}
&:hover {
background: $gray_4;
color: $white;
}
}
.show_news_butt {
display: block;
height:70px;
line-height: 70px;
text-align: center;
font-family: 'intro';
font-size: 16px;
color: $black_2;
background: transparent;
box-shadow: inset 0 0 0 2rem $gray_4;
transition: all .3s ease;
display: inline-block;
&:hover, &:focus {
text-decoration: none;
}
&:hover {
background: $gray_4;
color: $white;
}
}
&:hover, &:focus {
text-decoration: none;
}
Организация кнопок на сайте с помощью Sass