sass-site/source/assets/sass/vendor/_syntax-accessible.scss

121 lines
2.3 KiB
SCSS
Raw Normal View History

2023-01-19 22:16:48 +01:00
@use '../functions';
@use '../visual-design/typography';
2023-01-12 19:19:42 +01:00
/**
* Based on the GHColors theme by Avi Aryan (http://aviaryan.in)
2023-02-21 17:20:10 +01:00
* Inspired by GitHub syntax coloring
*/
2023-01-06 22:40:29 +01:00
code[class*="language-"],
pre[class*="language-"] {
2023-03-13 21:02:24 +01:00
background-color: var(--sl-color--code-background);
2023-02-09 22:15:01 +01:00
hyphens: none;
2023-02-21 17:29:45 +01:00
word-break: normal;
2023-02-24 21:56:47 +01:00
word-spacing: normal;
tab-size: 4;
2023-02-09 22:15:01 +01:00
text-align: left;
}
2023-02-21 17:29:45 +01:00
.token {
color: var(--sl-color--code-text);
2023-02-21 17:29:45 +01:00
}
2023-02-24 21:56:47 +01:00
.token table td {
padding: functions.sl-px-to-rem(5px);
}
.token table pre {
margin: 0;
}
2023-01-06 22:40:29 +01:00
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
--sl-color--code-text: var(--sl-color--code-muted);
2023-02-24 21:56:47 +01:00
font-style: italic;
2023-01-06 22:40:29 +01:00
}
[class*='language-scss'] {
--sl-color--code-text: var(--sl-color--code-base);
}
[class*='language-css'] {
2023-02-24 21:56:47 +01:00
& .token.comment {
--sl-color--code-text: var(--sl-color--code-base);
}
2023-02-24 21:56:47 +01:00
}
2023-01-06 22:40:29 +01:00
.token.namespace {
2023-02-24 21:56:47 +01:00
opacity: 0.7;
2023-01-06 22:40:29 +01:00
}
.token.string,
.token.attr-value {
--sl-color--code-text: var(--sl-color--code-bright);
2023-01-06 22:40:29 +01:00
}
.token.punctuation,
.token.operator {
--sl-color--code-text: var(--sl-color--code-muted-dark);
2023-02-24 21:56:47 +01:00
/* no highlight */
font-weight: typography.$sl-font-weight--bold;
2023-01-06 22:40:29 +01:00
}
.token.entity,
.token.url,
.token.symbol,
.token.number,
.token.boolean,
.token.constant,
.token.property,
.token.regex,
.token.inserted {
--sl-color--code-text: var(--sl-color--code-warm);
font-weight: typography.$sl-font-weight--bold;
2023-01-06 22:40:29 +01:00
}
.token.atrule,
.token.keyword,
.token.attr-name,
.language-autohotkey .token.selector {
--sl-color--code-text: var(--sl-color--code-dark);
font-weight: typography.$sl-font-weight--bold;
2023-01-06 22:40:29 +01:00
}
.token.function,
.token.deleted,
.language-autohotkey .token.tag {
--sl-color--code-text: var(--sl-color--code-bright-dark);
2023-01-06 22:40:29 +01:00
}
.token.tag,
.token.selector,
.language-autohotkey .token.keyword {
--sl-color--code-text: var(--sl-color--code-cool);
font-weight: typography.$sl-font-weight--bold;
2023-01-06 22:40:29 +01:00
}
.token.important,
.token.function,
.token.bold {
font-weight: typography.$sl-font-weight--bold;
2023-01-06 22:40:29 +01:00
}
2023-02-24 21:56:47 +01:00
[class*="language-shell"] {
2023-02-22 17:11:29 +01:00
& .token.function {
--sl-color--code-text: unset;
font-weight: typography.$sl-font-weight--regular;
2023-02-22 17:11:29 +01:00
}
}
.token.italic {
2023-02-21 17:20:10 +01:00
font-style: italic;
2023-01-31 20:18:33 +01:00
}
2023-02-09 22:15:01 +01:00
.token.variable,
.token[class*="placeholder"] {
--sl-color--code-text: var(--sl-color--code-base);
font-weight: typography.$sl-font-weight--regular;
2023-02-25 00:16:57 +01:00
}