mirror of
https://github.com/Chalarangelo/mini.css.git
synced 2025-02-25 09:23:04 +01:00
510 lines
10 KiB
SCSS
510 lines
10 KiB
SCSS
// SECTION: Browsers resets and base typography.
|
|
//===================================================
|
|
$apply-defaults-to-all: true !default;
|
|
@if $apply-defaults-to-all {
|
|
html, * {
|
|
font-family: #{$base-font-family};
|
|
font-size: $base-font-size;
|
|
line-height: $base-line-height;
|
|
// Prevent adjustments of font size after orientation changes in mobile.
|
|
-webkit-text-size-adjust: 100%;
|
|
}
|
|
}
|
|
@else {
|
|
html {
|
|
font-family: #{$base-font-family};
|
|
font-size: $base-font-size;
|
|
line-height: $base-line-height;
|
|
// Prevent adjustments of font size after orientation changes in mobile.
|
|
-webkit-text-size-adjust: 100%;
|
|
}
|
|
}
|
|
|
|
body {
|
|
margin: $body-margin;
|
|
color: $fore-color;
|
|
background: $back-color;
|
|
}
|
|
|
|
// Correct display for older versions of IE.
|
|
// TODO: Move styling of `nav` to the proper file.
|
|
article, aside, footer, header, nav, section, figcaption, figure, main {
|
|
display: block;
|
|
}
|
|
|
|
abbr[title] {
|
|
border-bottom: none; // Remove bottom border in Firefox 39-.
|
|
text-decoration: underline; // Opinionated style-fix for all browsers.
|
|
// This is an artifact, please move along.
|
|
// &:hover:after { content: " ("attr(title) ")"; }
|
|
}
|
|
|
|
// Correct display for older versions of IE.
|
|
audio, video {
|
|
display: inline-block;
|
|
}
|
|
|
|
// Hide overflow in IE
|
|
svg:not(:root) {
|
|
overflow: hidden;
|
|
}
|
|
|
|
// Fix display in older versions of Android.
|
|
$include-dfn-fix: true !default;
|
|
@if $include-dfn-fix {
|
|
dfn {
|
|
font-style: italic;
|
|
}
|
|
}
|
|
|
|
h1, h2, h3, h4, h5, h6 {
|
|
line-height: $header-line-height;
|
|
margin: $header-margin;
|
|
font-weight: $header-font-weight;
|
|
small {
|
|
color: $header-smalltext-fore-color;
|
|
$make-header-smalltext-block: false !default;
|
|
@if $make-header-smalltext-block {
|
|
display: block;
|
|
@if $header-smalltext-b-top-margin != 0 {
|
|
margin-top: $header-smalltext-b-top-margin;
|
|
}
|
|
@if $header-smalltext-b-font-size != $small-font-size {
|
|
font-size: $header-smalltext-b-font-size;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
h1 {
|
|
font-size: $h1-font-size;
|
|
}
|
|
h2 {
|
|
font-size: $h2-font-size;
|
|
}
|
|
h3 {
|
|
font-size: $h3-font-size;
|
|
}
|
|
h4 {
|
|
font-size: $h4-font-size;
|
|
}
|
|
h5 {
|
|
font-size: $h5-font-size;
|
|
}
|
|
h6 {
|
|
font-size: $h6-font-size;
|
|
}
|
|
|
|
p {
|
|
margin: $paragraph-margin;
|
|
}
|
|
|
|
b, strong {
|
|
font-weight: $bold-font-weight;
|
|
}
|
|
|
|
hr {
|
|
// Fixes and defaults for styling
|
|
box-sizing: content-box;
|
|
border: 0;
|
|
overflow: visible;
|
|
// Actual styling using variables
|
|
line-height: $horizontal-rule-line-height;
|
|
margin: $horizontal-rule-margin;
|
|
$horizontal-rule-fancy-style: false !default;
|
|
@if $horizontal-rule-fancy-style {
|
|
height: 1px;
|
|
background: -webkit-linear-gradient(#{$horizontal-rule-fancy-gradient});
|
|
background: linear-gradient(#{$horizontal-rule-fancy-gradient});
|
|
}
|
|
@else {
|
|
height: 0;
|
|
border-top: $horizontal-rule-border-style;
|
|
}
|
|
}
|
|
|
|
$use-default-code-fonts: true !default;
|
|
@if $use-default-code-fonts {
|
|
code, kbd, pre, samp{
|
|
font-family: monospace, monospace; // Applies display fix for all code elements
|
|
}
|
|
}
|
|
@else {
|
|
code, kbd, pre, samp{
|
|
font-family: $code-font-family; // Display fix should be applied manually!
|
|
}
|
|
}
|
|
|
|
code {
|
|
@if $code-element-border-style != 0{
|
|
border: $code-element-border-style;
|
|
}
|
|
@if $code-element-border-radius != 0 {
|
|
border-radius: $code-element-border-radius;
|
|
}
|
|
@if $code-element-back-color != $back-color {
|
|
background: $code-element-back-color;
|
|
}
|
|
@if $code-element-fore-color != $fore-color {
|
|
color: $code-element-fore-color;
|
|
}
|
|
@if $code-element-padding != 0 {
|
|
padding: $code-element-padding;
|
|
}
|
|
}
|
|
|
|
pre {
|
|
overflow: auto; // Responsiveness
|
|
@if $pre-element-border-style != 0 {
|
|
border: $pre-element-border-style;
|
|
}
|
|
@if $pre-element-border-radius != 0 {
|
|
border-radius: $pre-element-border-radius;
|
|
}
|
|
@if $pre-element-back-color != $back-color {
|
|
background: $pre-element-back-color;
|
|
}
|
|
@if $pre-element-fore-color != $fore-color {
|
|
color: $pre-element-fore-color;
|
|
}
|
|
@if $pre-element-padding != 0 {
|
|
padding: $pre-element-padding;
|
|
}
|
|
@if pre-element-margin != 0 {
|
|
margin: $pre-element-margin;
|
|
}
|
|
$add-pre-element-sidebar: false !default;
|
|
@if $add-pre-element-sidebar {
|
|
border-left: $pre-element-sidebar-style;
|
|
}
|
|
}
|
|
|
|
kbd {
|
|
@if $kbd-element-border-style != 0 {
|
|
border: $kbd-element-border-style;
|
|
}
|
|
@if $kbd-element-border-radius != 0 {
|
|
border-radius: $kbd-element-border-radius;
|
|
}
|
|
@if $kbd-element-back-color != $back-color {
|
|
background: $kbd-element-back-color;
|
|
}
|
|
@if $kbd-element-fore-color != $fore-color {
|
|
color: $kbd-element-fore-color;
|
|
}
|
|
@if $kbd-element-padding != 0 {
|
|
padding: $kbd-element-padding;
|
|
}
|
|
}
|
|
|
|
$style-samp-element: false !default;
|
|
@if $style-samp-element {
|
|
samp{
|
|
@if $samp-element-border-style != 0 {
|
|
border: $samp-element-border-style;
|
|
}
|
|
@if $samp-element-border-radius != 0 {
|
|
border-radius: $samp-element-border-radius;
|
|
}
|
|
@if $samp-element-back-color != $back-color {
|
|
background: $samp-element-back-color;
|
|
}
|
|
@if $samp-element-fore-color != $fore-color {
|
|
color: $samp-element-fore-color;
|
|
}
|
|
@if $samp-element-padding != 0 {
|
|
padding: $samp-element-padding;
|
|
}
|
|
}
|
|
}
|
|
|
|
@if $small-font-size == $sub-font-size and $small-font-size == $sup-font-size {
|
|
small, sup, sub {
|
|
font-size: $small-font-size;
|
|
}
|
|
sup {
|
|
top: $sup-top;
|
|
}
|
|
sub{
|
|
bottom: $sub-bottom;
|
|
}
|
|
sup, sub {
|
|
line-height: 0;
|
|
position: relative;
|
|
vertical-align: baseline;
|
|
}
|
|
}
|
|
@else if $small-font-size == $sub-font-size {
|
|
small, sub {
|
|
font-size: $small-font-size;
|
|
}
|
|
sup {
|
|
font-size: $sup-font-size;
|
|
top: $sup-top;
|
|
}
|
|
sub {
|
|
bottom: $sub-bottom;
|
|
}
|
|
sup, sub {
|
|
line-height: 0;
|
|
position: relative;
|
|
vertical-align: baseline;
|
|
}
|
|
}
|
|
@else if $small-font-size == $sup-font-size {
|
|
small, sup {
|
|
font-size: $small-font-size;
|
|
}
|
|
sup {
|
|
top: $sup-top;
|
|
}
|
|
sub {
|
|
font-size: $sub-font-size;
|
|
bottom: $sub-bottom;
|
|
}
|
|
sup, sub {
|
|
line-height: 0;
|
|
position: relative;
|
|
vertical-align: baseline;
|
|
}
|
|
}
|
|
@else if $sup-font-size == $sub-font-size {
|
|
small {
|
|
font-size: $small-font-size;
|
|
}
|
|
sup, sub {
|
|
font-size: $sup-font-size;
|
|
line-height: 0;
|
|
position: relative;
|
|
vertical-align: baseline;
|
|
}
|
|
sup {
|
|
top: $sup-top;
|
|
}
|
|
sub{
|
|
bottom: $sub-bottom;
|
|
}
|
|
}
|
|
@else {
|
|
small {
|
|
font-size: $small-font-size;
|
|
}
|
|
sup {
|
|
font-size: $sup-font-size;
|
|
top: $sup-top;
|
|
}
|
|
sub{
|
|
font-size: $sub-font-size;
|
|
bottom: $sub-bottom;
|
|
}
|
|
sup, sub {
|
|
line-height: 0;
|
|
position: relative;
|
|
vertical-align: baseline;
|
|
}
|
|
}
|
|
|
|
$apply-link-underline: true !default;
|
|
$apply-link-hover-fade: true !default;
|
|
a{
|
|
color: $link-fore-color;
|
|
@if $apply-link-underline {
|
|
text-decoration: underline;
|
|
}
|
|
@else {
|
|
text-decoration: none;
|
|
}
|
|
@if $link-font-weight != 500 {
|
|
font-weight: $link-font-weight;
|
|
}
|
|
@if $apply-link-hover-fade {
|
|
opacity: 1;
|
|
transition: all 0.3s ease 0s;
|
|
}
|
|
&:visited {
|
|
color: $link-visited-fore-color;
|
|
}
|
|
@if $apply-link-hover-fade {
|
|
&:hover, &:focus, &:active {
|
|
opacity: 0.75;
|
|
}
|
|
}
|
|
@else {
|
|
&:hover, &:focus, &:active {
|
|
color: $link-hover-fore-color;
|
|
}
|
|
}
|
|
}
|
|
//===================================================
|
|
// SECTION: External files.
|
|
//===================================================
|
|
// You can comment out modules you do not want to use.
|
|
@import 'mini-core/contextual';
|
|
@import 'mini-core/progress';
|
|
|
|
// TODO: Move to forms and buttons respectively
|
|
|
|
/**
|
|
* 1. Change the font styles in all browsers (opinionated).
|
|
* 2. Remove the margin in Firefox and Safari.
|
|
*/
|
|
|
|
button,
|
|
input,
|
|
optgroup,
|
|
select,
|
|
textarea {
|
|
font-family: sans-serif; /* 1 */
|
|
font-size: 100%; /* 1 */
|
|
line-height: 1.15; /* 1 */
|
|
margin: 0; /* 2 */
|
|
}
|
|
|
|
/**
|
|
* Show the overflow in IE.
|
|
* 1. Show the overflow in Edge.
|
|
*/
|
|
|
|
button,
|
|
input { /* 1 */
|
|
overflow: visible;
|
|
}
|
|
|
|
/**
|
|
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
* 1. Remove the inheritance of text transform in Firefox.
|
|
*/
|
|
|
|
button,
|
|
select { /* 1 */
|
|
text-transform: none;
|
|
}
|
|
|
|
/**
|
|
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
|
|
* controls in Android 4.
|
|
* 2. Correct the inability to style clickable types in iOS and Safari.
|
|
*/
|
|
|
|
button,
|
|
html [type="button"], /* 1 */
|
|
[type="reset"],
|
|
[type="submit"] {
|
|
-webkit-appearance: button; /* 2 */
|
|
}
|
|
|
|
/**
|
|
* Remove the inner border and padding in Firefox.
|
|
*/
|
|
|
|
button::-moz-focus-inner,
|
|
[type="button"]::-moz-focus-inner,
|
|
[type="reset"]::-moz-focus-inner,
|
|
[type="submit"]::-moz-focus-inner {
|
|
border-style: none;
|
|
padding: 0;
|
|
}
|
|
|
|
/**
|
|
* Restore the focus styles unset by the previous rule.
|
|
*/
|
|
|
|
button:-moz-focusring,
|
|
[type="button"]:-moz-focusring,
|
|
[type="reset"]:-moz-focusring,
|
|
[type="submit"]:-moz-focusring {
|
|
outline: 1px dotted ButtonText;
|
|
}
|
|
|
|
/**
|
|
* Change the border, margin, and padding in all browsers (opinionated).
|
|
*/
|
|
|
|
fieldset {
|
|
border: 1px solid #c0c0c0;
|
|
margin: 0 2px;
|
|
padding: 0.35em 0.625em 0.75em;
|
|
}
|
|
|
|
/**
|
|
* 1. Correct the text wrapping in Edge and IE.
|
|
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
* 3. Remove the padding so developers are not caught out when they zero out
|
|
* `fieldset` elements in all browsers.
|
|
*/
|
|
|
|
legend {
|
|
box-sizing: border-box; /* 1 */
|
|
color: inherit; /* 2 */
|
|
display: table; /* 1 */
|
|
max-width: 100%; /* 1 */
|
|
padding: 0; /* 3 */
|
|
white-space: normal; /* 1 */
|
|
}
|
|
|
|
/**
|
|
* Remove the default vertical scrollbar in IE.
|
|
*/
|
|
|
|
// TODO: Move to forms
|
|
|
|
textarea {
|
|
overflow: auto;
|
|
}
|
|
|
|
/**
|
|
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
*/
|
|
|
|
[type="number"]::-webkit-inner-spin-button,
|
|
[type="number"]::-webkit-outer-spin-button {
|
|
height: auto;
|
|
}
|
|
|
|
/**
|
|
* 1. Correct the odd appearance in Chrome and Safari.
|
|
* 2. Correct the outline style in Safari.
|
|
*/
|
|
|
|
[type="search"] {
|
|
-webkit-appearance: textfield; /* 1 */
|
|
outline-offset: -2px; /* 2 */
|
|
}
|
|
|
|
/**
|
|
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
|
|
*/
|
|
|
|
[type="search"]::-webkit-search-cancel-button,
|
|
[type="search"]::-webkit-search-decoration {
|
|
-webkit-appearance: none;
|
|
}
|
|
|
|
/**
|
|
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
* 2. Change font properties to `inherit` in Safari.
|
|
*/
|
|
|
|
::-webkit-file-upload-button {
|
|
-webkit-appearance: button; /* 1 */
|
|
font: inherit; /* 2 */
|
|
}
|
|
|
|
/*
|
|
* Add the correct display in IE 9-.
|
|
* 1. Add the correct display in Edge, IE, and Firefox.
|
|
*/
|
|
|
|
details, /* 1 */
|
|
menu {
|
|
display: block;
|
|
}
|
|
|
|
/*
|
|
* Add the correct display in all browsers.
|
|
*/
|
|
|
|
summary {
|
|
display: list-item;
|
|
}
|
|
//=================================================== |