Skip to content

Commit 18ce8bb

Browse files
author
Alice Koreman
committed
small fixes after merging up to main
1 parent ed856c0 commit 18ce8bb

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"size-limit": [
147147
{
148148
"path": "lib/components/index.js",
149-
"limit": "6.25kb"
149+
"limit": "6.52kb"
150150
},
151151
{
152152
"path": "lib/components/code-view/highlight/javascript.js",

src/code-view/__tests__/code-view.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ describe("CodeView", () => {
1616
test("correctly renders simple content", () => {
1717
render(<CodeView content={"Hello World"}></CodeView>);
1818
const wrapper = createWrapper()!.findCodeView();
19-
expect(wrapper!.findContent().getElement()).toHaveTextContent("Hello World");
19+
expect(wrapper!.findContent()[0].getElement()).toHaveTextContent("Hello World");
2020
});
2121

2222
test("correctly renders multi line content", () => {
2323
render(<CodeView content={`# Hello World\n\nThis is a markdown example.`}></CodeView>);
2424
const wrapper = createWrapper()!.findCodeView()!;
2525
const content = wrapper.findContent();
26-
expect(content.getElement()).toHaveTextContent("# Hello World This is a markdown example.");
27-
expect(wrapper!.findContent()[0].getElement()).toHaveTextContent("Hello World");
26+
expect(content[0].getElement()).toHaveTextContent("# Hello World");
27+
expect(content[1].getElement()).toHaveTextContent("");
28+
expect(content[2].getElement()).toHaveTextContent("This is a markdown example.");
2829
});
2930

3031
test("correctly renders multi line content", () => {

src/code-view/styles.scss

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,18 @@
33
SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
/*
7-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
8-
SPDX-License-Identifier: Apache-2.0
9-
*/
10-
11-
/*
12-
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13-
SPDX-License-Identifier: Apache-2.0
14-
*/
15-
166
@use "../../node_modules/@cloudscape-design/design-tokens/index.scss" as cs;
177

188
$color-background-code-view-light: #f8f8f8;
199
$color-background-code-view-dark: #282c34;
2010

2111
.root {
2212
position: relative;
13+
background-color: $color-background-code-view-light;
2314
:global(.awsui-dark-mode) &,
2415
:global(.awsui-polaris-dark-mode) & {
2516
background-color: $color-background-code-view-dark;
2617
}
27-
background-color: $color-background-code-view-light;
2818
}
2919

3020
.scroll-container {
@@ -53,10 +43,6 @@ $color-background-code-view-dark: #282c34;
5343

5444
.line-number {
5545
border-right-color: cs.$color-border-divider-default;
56-
:global(.awsui-dark-mode) &,
57-
:global(.awsui-polaris-dark-mode) & {
58-
background-color: $color-background-code-view-dark;
59-
}
6046
background-color: $color-background-code-view-light;
6147
vertical-align: text-top;
6248
position: sticky;
@@ -65,6 +51,10 @@ $color-background-code-view-dark: #282c34;
6551
border-right-style: solid;
6652
padding-left: cs.$space-static-xs;
6753
padding-right: cs.$space-static-xs;
54+
:global(.awsui-dark-mode) &,
55+
:global(.awsui-polaris-dark-mode) & {
56+
background-color: $color-background-code-view-dark;
57+
}
6858
}
6959

7060
.unselectable {

0 commit comments

Comments
 (0)