Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): update code components to use css modules
- Loading branch information
Showing
10 changed files
with
298 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/documentation/src/components/Blockquote.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@use '../everything' as *; | ||
|
||
.blockquote { | ||
$border-style: 0.25em solid rmd-divider-theme-var(background-color); | ||
|
||
@include rmd-theme(color, text-secondary-on-background); | ||
@include rmd-typography(subtitle-1); | ||
@include rmd-utils-rtl-auto(border-left, $border-style); | ||
|
||
font-style: italic; | ||
margin: 1em 0; | ||
padding: 0.5em 1em; | ||
position: relative; | ||
|
||
p:only-child { | ||
margin: 0; | ||
} | ||
|
||
p:last-child { | ||
margin-bottom: 0; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/documentation/src/components/Code/Code.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@use '../../everything' as *; | ||
|
||
.code { | ||
@include rmd-typography(body-1); | ||
|
||
font-family: 'Source Code Pro', Consolas, Monaco, monospace; | ||
} | ||
|
||
.inline { | ||
color: var(--code-color); | ||
white-space: pre-wrap; | ||
} | ||
|
||
.ticked { | ||
&::before, | ||
&::after { | ||
content: '\`'; | ||
} | ||
} | ||
|
||
.oneline { | ||
white-space: nowrap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
packages/documentation/src/components/Code/CodeBlock.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
@use '../../everything' as *; | ||
|
||
.block { | ||
@include rmd-typography(body-1); | ||
|
||
background-color: $solarized-base-03; | ||
color: $solarized-base-1; | ||
|
||
// always enforce ltr for blocked code | ||
direction: ltr; | ||
font-family: 'Source Code Pro', Consolas, Monaco, monospace; | ||
margin: 0.5em 0; | ||
overflow: auto; | ||
padding: 1em; | ||
|
||
&::selection, | ||
*::selection { | ||
background-color: $solarized-base-02; | ||
} | ||
|
||
// to help with the collapse transition on expandable code, update it so | ||
// that only the vertical overflow is hidden. | ||
&.rmd-collapse--no-overflow { | ||
overflow-y: hidden; | ||
} | ||
|
||
// prismjs custom theme | ||
// this is _basically_ my current vim theme, but not aas good since | ||
// Prism doesn't have as many tokenizers | ||
:global { | ||
.token { | ||
position: relative; | ||
z-index: 1; | ||
|
||
&.comment, | ||
&.doctype { | ||
color: $solarized-base-01; | ||
} | ||
|
||
&.keyword { | ||
color: $solarized-green; | ||
} | ||
|
||
&.punctuation { | ||
color: $solarized-base-01; | ||
} | ||
|
||
&.inserted, | ||
&.string, | ||
.language-tsx &.attr-value { | ||
color: $solarized-cyan; | ||
} | ||
|
||
&.tag, | ||
&.selector, | ||
&.class-name { | ||
color: $solarized-blue; | ||
} | ||
|
||
&.attr-name, | ||
&.property, | ||
&.builtin { | ||
color: $solarized-yellow; | ||
} | ||
|
||
&.script, | ||
&.interpolation { | ||
color: $solarized-base-1; | ||
} | ||
|
||
&.deleted, | ||
&.boolean, | ||
&.number, | ||
&.interpolation-punctuation { | ||
color: $solarized-red; | ||
} | ||
|
||
&.important, | ||
&.bold { | ||
font-weight: map-get($rmd-typography-font-weights, bold); | ||
} | ||
|
||
&.italic { | ||
font-style: italic; | ||
} | ||
|
||
&.entity { | ||
cursor: help; | ||
} | ||
} | ||
} | ||
|
||
&:global(.language-scss) :global .token.function, | ||
&:global(.language-scss) :global .token.variable { | ||
color: $solarized-blue; | ||
} | ||
|
||
&:global(.language-ts) :global .token + .class-name, | ||
&:global(.language-tsx) :global .token + .class-name { | ||
color: $solarized-base-1; | ||
} | ||
|
||
&:global(.language-scss) :global .token.function, | ||
&:global(.language-shell) :global .token.function { | ||
color: $solarized-orange; | ||
} | ||
} | ||
|
||
.counted { | ||
padding-left: 3em; | ||
position: relative; | ||
} |
Oops, something went wrong.