Skip to content

Commit

Permalink
fix: handled style change in ServerUrl and ServersOverlay dynamically (
Browse files Browse the repository at this point in the history
…#1989)

Co-authored-by: Alex Varchuk <[email protected]>
  • Loading branch information
pranitkhadilkar7 and AlexVarchuk authored Jun 1, 2022
1 parent c513b28 commit a366de4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ You can use all of the following options with the standalone version of the <red
* `backgroundColor`: '#263238'
* `width`: '40%'
* `textColor`: '#ffffff'
* `servers`
* `overlay`
* `backgroundColor`: '#fafafa'
* `textColor`: '#263238'
* `url`
* `backgroundColor`: '#fff'
* `fab`
* `backgroundColor`: '#263238'
* `color`: '#ffffff'
Expand Down
6 changes: 3 additions & 3 deletions src/components/Endpoint/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export const ServersOverlay = styled.div<{ expanded: boolean }>`
position: absolute;
width: 100%;
z-index: 100;
background: #fafafa;
color: #263238;
background: ${props => props.theme.rightPanel.servers.overlay.backgroundColor};
color: ${props => props.theme.rightPanel.servers.overlay.textColor};
box-sizing: border-box;
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.33);
overflow: hidden;
Expand All @@ -78,7 +78,7 @@ export const ServerItem = styled.div`
export const ServerUrl = styled.div`
padding: 5px;
border: 1px solid #ccc;
background: #fff;
background: ${props => props.theme.rightPanel.servers.url.backgroundColor};
word-break: break-all;
color: ${props => props.theme.colors.primary.main};
> span {
Expand Down
20 changes: 20 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ const defaultTheme: ThemeInterface = {
backgroundColor: '#263238',
width: '40%',
textColor: '#ffffff',
servers: {
overlay: {
backgroundColor: '#fafafa',
textColor: '#263238',
},
url: {
backgroundColor: '#fff',
},
},
},
codeBlock: {
backgroundColor: ({ rightPanel }) => darken(0.1, rightPanel.backgroundColor),
Expand Down Expand Up @@ -231,6 +240,16 @@ export interface FontSettings {
color: string;
}

export interface Servers {
overlay: {
backgroundColor: string;
textColor: string;
};
url: {
backgroundColor: string;
};
}

export interface ResolvedThemeInterface {
spacing: {
unit: number;
Expand Down Expand Up @@ -350,6 +369,7 @@ export interface ResolvedThemeInterface {
backgroundColor: string;
textColor: string;
width: string;
servers: Servers;
};
codeBlock: {
backgroundColor: string;
Expand Down

0 comments on commit a366de4

Please sign in to comment.