cheatsheets/_sass/2017/components/h3-section.scss

184 lines
2.7 KiB
SCSS

/*
* H3 section
*/
.h3-section > .body {
& > pre {
margin: 0;
padding: 16px;
}
& {
background: white;
box-shadow: $shadow3;
}
/* Collapse/flush */
@media (max-width: 480px) {
margin: 0 -16px;
box-shadow: $shadow2;
}
/* Border radius */
@media (min-width: 481px) {
& {
border-radius: 2px;
}
& > :first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
& > :last-child {
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
}
}
/*
* Heading
*/
.h3-section > h3 {
& {
@include section-gutter(margin-bottom, $multiplier: 1);
@include section-gutter(margin-top, $multiplier: .5);
white-space: nowrap;
overflow: hidden;
}
&::after {
@include section-gutter(margin-left, $multiplier: 1.5);
content: '';
display: inline-block;
vertical-align: middle;
width: 100%;
height: 1px;
background: linear-gradient(to right, rgba($base-a, 0.3), transparent 80%);
}
}
/*
* Children
*/
.h3-section > .body {
/* Lists */
& > ul {
margin: 0;
padding: 0;
list-style-type: none;
}
& > ul > li {
padding: 8px;
padding-left: 32px + 4px;
position: relative;
}
& > ul > li > p {
margin: 0;
padding: 0;
}
& > ul > li::before {
content: '';
position: absolute;
display: inline-block;
width: 4px;
height: 4px;
background: $gray-text;
border-radius: 50%;
left: 16px;
top: 16px + 2px;
}
& > ul > li + li {
border-top: solid 1px $line-color;
}
/* Paragraphs */
& > p {
padding: 16px;
margin: 0;
}
/* Description paragraphs */
& > pre ~ p,
& > ul ~ p,
& > iframe ~ p,
& > table ~ p {
background: $gray-bg;
color: $gray-text;
/* Links */
& a,
& a:visited {
color: $base-text;
text-decoration: none;
border-bottom: solid 1px $line-color;
}
& a:hover {
color: $base-b;
}
}
/* Line divisions */
& > *:not(:first-child) {
border-top: solid 1px $line-color;
}
}
/*
* Variant: Prime
*/
.h3-section.-prime > .body {
@media (min-width: 481px) {
border-radius: 2px;
box-shadow: $shadow6;
}
}
/*
* Variant: Also see :\
*/
ul.-also-see.-also-see.-also-see {
display: flex;
flex-wrap: wrap;
background: $gray-bg;
& > li {
flex: 1 0 20%;
padding: 24px;
border-top: solid 1px $dark-line-color;
& + li {
border-left: solid 1px $dark-line-color;
}
}
&,
& > li {
list-style-type: none;
}
& > li::before {
display: none;
}
& > li > a {
@include font-size(1);
display: block;
}
& > li > em {
@include font-size(-1);
display: block;
}
}