pico/scss/content/_code.scss

97 lines
1.7 KiB
SCSS
Raw Normal View History

2019-11-27 15:31:49 +07:00
/**
* Code
*/
// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v12.0.1 | CC0 1.0 Universal | github.com/csstools/sanitize.css
2019-11-27 15:31:49 +07:00
//
// 1. Correct the inheritance and scaling of font size in all browsers
// 2. Correct the odd `em` font sizing in all browsers
2019-11-27 15:31:49 +07:00
pre,
code,
kbd,
samp {
2021-07-02 16:54:41 +07:00
font-family: var(--font-family); // 1
font-size: .875rem; // 2
2019-11-27 15:31:49 +07:00
}
// Prevent overflow of the container in all browsers (opinionated)
pre {
-ms-overflow-style: scrollbar;
overflow: auto;
}
2019-11-27 15:31:49 +07:00
// Pico
//
pre,
code,
kbd {
2021-07-02 16:54:41 +07:00
background: var(--code-background-color);
color: var(--code-color);
font-weight: var(--font-weight);
line-height: initial;
2019-11-27 15:31:49 +07:00
}
code,
kbd {
display: inline-block;
padding: .375rem .5rem;
2021-07-02 16:54:41 +07:00
border-radius: var(--border-radius);
2019-11-27 15:31:49 +07:00
}
pre {
display: block;
2021-07-02 16:54:41 +07:00
margin-bottom: var(--spacing);
padding: var(--spacing);
2019-11-27 15:31:49 +07:00
overflow-x: auto;
2021-07-02 16:54:41 +07:00
background: var(--code-background-color);
2019-11-27 15:31:49 +07:00
> code {
display: block;
padding: 0;
background: transparent;
font-size: 14px;
2020-09-29 08:38:35 +07:00
line-height: var(--line-height);
2019-11-27 15:31:49 +07:00
}
}
2021-07-02 16:54:41 +07:00
// Code Syntax
2019-11-27 15:31:49 +07:00
code {
// Tags
b {
2021-07-02 16:54:41 +07:00
color: var(--code-tag-color);
font-weight: var(--font-weight);
2019-11-27 15:31:49 +07:00
}
// Properties
i {
2021-07-02 16:54:41 +07:00
color: var(--code-property-color);
2019-11-27 15:31:49 +07:00
font-style: normal;
}
// Values
u {
2021-07-02 16:54:41 +07:00
color: var(--code-value-color);
2019-11-27 15:31:49 +07:00
text-decoration: none;
}
// Comments
em {
2021-07-02 16:54:41 +07:00
color: var(--code-comment-color);
font-style: normal;
}
2019-11-27 15:31:49 +07:00
}
// kbd
kbd {
2021-07-02 16:54:41 +07:00
background-color: var(--code-kbd-background-color);
color: var(--code-kbd-color);
vertical-align: middle;
2019-11-27 15:31:49 +07:00
}