Skip to content

Commit 4c492b3

Browse files
committed
chore(docs): Separate Code and CodeBlock into separate folders
1 parent 93ebaa4 commit 4c492b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+91
-87
lines changed

packages/documentation/src/_everything.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,3 @@
55
$rmd-theme-secondary: $rmd-pink-a-200,
66
$rmd-utils-auto-dense: true
77
);
8-
9-
$solarized-base-03: #002b36;
10-
$solarized-base-02: #073642;
11-
$solarized-base-01: #586e75;
12-
$solarized-base-00: #657b83;
13-
$solarized-base-0: #839496;
14-
$solarized-base-1: #93a1a1;
15-
$solarized-base-2: #eee8d5;
16-
$solarized-base-3: #fdf6e3;
17-
18-
$solarized-yellow: #b58900;
19-
$solarized-orange: #cb4b16;
20-
$solarized-red: #d30102;
21-
$solarized-magenta: #d33682;
22-
$solarized-violet: #6c71c4;
23-
$solarized-blue: #268bd2;
24-
$solarized-cyan: #2aa198;
25-
$solarized-green: #859900;

packages/documentation/src/components/Code/Code.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use '../../everything' as *;
1+
@use 'react-md' as *;
22

33
.code {
44
@include rmd-typography(body-1);
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export { default as Code } from "./Code";
2-
export { default as CodeBlock } from "./CodeBlock";
1+
export { default } from "./Code";

packages/documentation/src/components/Code/CodeBlock.module.scss renamed to packages/documentation/src/components/CodeBlock/CodeBlock.module.scss

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
@use '../../everything' as *;
1+
@use 'react-md' as *;
2+
@use './solarized';
23

34
.block {
45
@include rmd-typography(body-1);
56

6-
background-color: $solarized-base-03;
7-
color: $solarized-base-1;
7+
background-color: solarized.$base-03;
8+
color: solarized.$base-1;
89

910
// always enforce ltr for blocked code
1011
direction: ltr;
@@ -15,7 +16,7 @@
1516

1617
&::selection,
1718
*::selection {
18-
background-color: $solarized-base-02;
19+
background-color: solarized.$base-02;
1920
}
2021

2122
// to help with the collapse transition on expandable code, update it so
@@ -34,45 +35,45 @@
3435

3536
&.comment,
3637
&.doctype {
37-
color: $solarized-base-01;
38+
color: solarized.$base-01;
3839
}
3940

4041
&.keyword {
41-
color: $solarized-green;
42+
color: solarized.$green;
4243
}
4344

4445
&.punctuation {
45-
color: $solarized-base-01;
46+
color: solarized.$base-01;
4647
}
4748

4849
&.inserted,
4950
&.string,
5051
.language-tsx &.attr-value {
51-
color: $solarized-cyan;
52+
color: solarized.$cyan;
5253
}
5354

5455
&.tag,
5556
&.selector,
5657
&.class-name {
57-
color: $solarized-blue;
58+
color: solarized.$blue;
5859
}
5960

6061
&.attr-name,
6162
&.property,
6263
&.builtin {
63-
color: $solarized-yellow;
64+
color: solarized.$yellow;
6465
}
6566

6667
&.script,
6768
&.interpolation {
68-
color: $solarized-base-1;
69+
color: solarized.$base-1;
6970
}
7071

7172
&.deleted,
7273
&.boolean,
7374
&.number,
7475
&.interpolation-punctuation {
75-
color: $solarized-red;
76+
color: solarized.$red;
7677
}
7778

7879
&.important,
@@ -92,16 +93,16 @@
9293

9394
&:global(.language-scss) :global .token.function,
9495
&:global(.language-scss) :global .token.variable {
95-
color: $solarized-blue;
96+
color: solarized.$blue;
9697
}
9798

9899
&:global(.language-ts) :global .token + .class-name {
99-
color: $solarized-base-1;
100+
color: solarized.$base-1;
100101
}
101102

102103
&:global(.language-scss) :global .token.function,
103104
&:global(.language-shell) :global .token.function {
104-
color: $solarized-orange;
105+
color: solarized.$orange;
105106
}
106107
}
107108

packages/documentation/src/components/Code/CodeBlock.tsx renamed to packages/documentation/src/components/CodeBlock/CodeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import React, {
66
} from "react";
77
import cn from "classnames";
88

9+
import Code from "../Code";
910
import styles from "./CodeBlock.module.scss";
10-
import Code from "./Code";
1111
import LineNumbers from "./LineNumbers";
1212
import { highlightCode } from "./utils";
1313

packages/documentation/src/components/Code/LineNumbers.module.scss renamed to packages/documentation/src/components/CodeBlock/LineNumbers.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
@use '../../everything' as *;
1+
@use './solarized';
22

33
.container {
4-
border-right: 1px solid $solarized-base-01;
4+
border-right: 1px solid solarized.$base-01;
55
counter-reset: line-numbers;
66
display: flex;
77
flex-direction: column;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$base-03: #002b36;
2+
$base-02: #073642;
3+
$base-01: #586e75;
4+
$base-00: #657b83;
5+
$base-0: #839496;
6+
$base-1: #93a1a1;
7+
$base-2: #eee8d5;
8+
$base-3: #fdf6e3;
9+
10+
$yellow: #b58900;
11+
$orange: #cb4b16;
12+
$red: #d30102;
13+
$magenta: #d33682;
14+
$violet: #6c71c4;
15+
$blue: #268bd2;
16+
$cyan: #2aa198;
17+
$green: #859900;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from "./CodeBlock";

0 commit comments

Comments
 (0)