hacks-guide-minimal-mistake.../_assets/css/_notices.scss
2016-03-10 13:06:59 -05:00

80 lines
No EOL
1.7 KiB
SCSS

/* ==========================================================================
NOTICE TEXT BLOCKS
========================================================================== */
/**
* Default Kramdown usage (no indents!):
* <div class="notice" markdown="1">
* #### Headline for the Notice
* Text for the notice
* </div>
*/
@mixin notice($notice-color) {
margin: 2em 0;
padding: 1em;
background-color: mix(#fff, $notice-color, 90%);
border-top: 0.25em solid mix(#fff, $notice-color, 50%);
border-bottom: 0.25em solid mix(#fff, $notice-color, 50%);
h4 {
margin-top: 0 !important; // override
margin-bottom: 0.75em;
line-height: 1 !important; // override
}
@at-root .page__content #{&} h4 {
// using at-root to override .page-content h4 font size
margin-bottom: 0;
font-size: 1rem;
}
@at-root .page__content #{&} a {
border-bottom-width: 2px;
box-shadow: none !important; // override
&:hover {
background-color: transparent !important; // override
}
}
p {
margin-bottom: 0;
a {
border-bottom: 1px solid mix(#fff, $notice-color, 50%) !important; // override
}
}
h4 + p {
// remove space above paragraphs that appear directly after notice headline
margin-top: 0;
padding-top: 0;
}
code {
background-color: mix(#fff, $notice-color, 70%)
}
}
/* Default notice */
.notice {
@include notice($primary-color);
}
/* Info notice */
.notice--info {
@include notice($info-color);
}
/* Warning notice */
.notice--warning {
@include notice($warning-color);
}
/* Success notice */
.notice--success {
@include notice($success-color);
}
/* Danger notice */
.notice--danger {
@include notice($danger-color);
}