Skip to content

Commit 8250a67

Browse files
authored
[patch] Add css reset (#63)
1 parent fd95dba commit 8250a67

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed

.changeset/eight-mails-thank.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@skip-go/widget': patch
3+
---
4+
5+
Add cssReset to widget

examples/nextjs/styles/globals.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ body {
99
}
1010

1111
input {
12-
background-color: black;
12+
background: black;
13+
}
14+
15+
div,
16+
p,
17+
span {
18+
color: gray;
19+
border: 2px solid gray;
20+
background: gray;
1321
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* Reset relevant styles within Shadow DOM */
2+
* {
3+
font-family: unset;
4+
font-style: unset;
5+
font-weight: unset;
6+
text-align: revert;
7+
text-decoration: unset;
8+
text-indent: unset;
9+
text-transform: unset;
10+
line-height: unset;
11+
letter-spacing: unset;
12+
white-space: unset;
13+
box-sizing: border-box;
14+
margin: unset;
15+
padding: unset;
16+
visibility: unset;
17+
float: unset;
18+
clear: unset;
19+
background-color: unset;
20+
word-spacing: unset;
21+
}
22+
23+
div,
24+
p,
25+
span {
26+
color: black;
27+
}

packages/widget/src/ui/Widget.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ export const SwapWidgetUI = ({
294294
}
295295
}}
296296
>
297-
<div key={accountStateKey} className="animate-slide-up-and-fade">
297+
<div
298+
key={accountStateKey}
299+
className="animate-slide-up-and-fade text-white"
300+
>
298301
{!srcAccount?.isWalletConnected && 'Connect Wallet'}
299302
</div>
300303
</button>

packages/widget/src/ui/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { SwapWidgetUI } from './Widget';
88
import shadowDomStyles from '../styles/shadowDomStyles.css';
99
import toastStyles from '../styles/toastStyles.css';
10+
import cssReset from '../styles/cssReset.css';
1011
import { Scope } from 'react-shadow-scope';
1112
import { useInjectFontsToDocumentHead } from '../hooks/use-inject-fonts-to-document-head';
1213

@@ -42,7 +43,7 @@ export const SwapWidget: React.FC<SwapWidgetProps> = ({
4243

4344
return (
4445
<Scope
45-
stylesheets={[toastStyles, shadowDomStyles]}
46+
stylesheets={[cssReset, toastStyles, shadowDomStyles]}
4647
config={{ dsd: 'emulated' }}
4748
>
4849
<SwapWidgetProvider {...swapWidgetProviderProps}>

0 commit comments

Comments
 (0)