feat: dark mode (tabs and request tabs)

This commit is contained in:
Anoop M D 2022-10-23 03:21:23 +05:30
parent 4718c77e3d
commit 23400a77f8
15 changed files with 82 additions and 58 deletions

View File

@ -8,11 +8,11 @@ const Wrapper = styled.div`
thead, thead,
td { td {
border: 1px solid #efefef; border: 1px solid ${(props) => props.theme.table.border};
} }
thead { thead {
color: #616161; color: ${(props) => props.theme.table.thead.color};;
font-size: 0.8125rem; font-size: 0.8125rem;
user-select: none; user-select: none;
} }

View File

@ -8,11 +8,11 @@ const Wrapper = styled.div`
thead, thead,
td { td {
border: 1px solid #efefef; border: 1px solid ${(props) => props.theme.table.border};
} }
thead { thead {
color: #616161; color: ${(props) => props.theme.table.thead.color};;
font-size: 0.8125rem; font-size: 0.8125rem;
user-select: none; user-select: none;
} }

View File

@ -35,8 +35,8 @@ const StyledWrapper = styled.div`
.react-tabs__tab--selected { .react-tabs__tab--selected {
border: none; border: none;
color: #322e2c !important; color: ${(props) => props.theme.tabs.active.color} !important;
border-bottom: solid 2px var(--color-tab-active-border) !important; border-bottom: solid 2px ${(props) => props.theme.tabs.active.border} !important;
border-color: var(--color-tab-active-border) !important; border-color: var(--color-tab-active-border) !important;
background: inherit; background: inherit;
outline: none !important; outline: none !important;
@ -50,7 +50,7 @@ const StyledWrapper = styled.div`
border: none; border: none;
outline: none !important; outline: none !important;
box-shadow: none !important; box-shadow: none !important;
border-bottom: solid 2px var(--color-tab-active-border) !important; border-bottom: solid 2px ${(props) => props.theme.tabs.active.border} !important;
border-color: var(--color-tab-active-border) !important; border-color: var(--color-tab-active-border) !important;
background: inherit; background: inherit;
outline: none !important; outline: none !important;

View File

@ -20,8 +20,8 @@ const StyledWrapper = styled.div`
} }
&.active { &.active {
color: #322e2c !important; color: ${(props) => props.theme.tabs.active.color} !important;
border-bottom: solid 2px var(--color-tab-active-border) !important; border-bottom: solid 2px ${(props) => props.theme.tabs.active.border} !important;
} }
} }
} }

View File

@ -8,11 +8,11 @@ const Wrapper = styled.div`
thead, thead,
td { td {
border: 1px solid #efefef; border: 1px solid ${(props) => props.theme.table.border};
} }
thead { thead {
color: #616161; color: ${(props) => props.theme.table.thead.color};;
font-size: 0.8125rem; font-size: 0.8125rem;
user-select: none; user-select: none;
} }

View File

@ -8,11 +8,11 @@ const Wrapper = styled.div`
thead, thead,
td { td {
border: 1px solid #efefef; border: 1px solid ${(props) => props.theme.table.border};
} }
thead { thead {
color: #616161; color: ${(props) => props.theme.table.thead.color};;
font-size: 0.8125rem; font-size: 0.8125rem;
user-select: none; user-select: none;
} }

View File

@ -8,11 +8,11 @@ const Wrapper = styled.div`
thead, thead,
td { td {
border: 1px solid #efefef; border: 1px solid ${(props) => props.theme.table.border};
} }
thead { thead {
color: #616161; color: ${(props) => props.theme.table.thead.color};;
font-size: 0.8125rem; font-size: 0.8125rem;
user-select: none; user-select: none;
} }

View File

@ -18,11 +18,11 @@ const StyledWrapper = styled.div`
display: flex; display: flex;
height: 100%; height: 100%;
width: 1px; width: 1px;
border-left: solid 1px var(--color-request-dragbar-background); border-left: solid 1px ${(props) => props.theme.requestTabPanel.dragbar.border};
} }
&:hover div.drag-request-border { &:hover div.drag-request-border {
border-left: solid 1px var(--color-request-dragbar-background-active); border-left: solid 1px ${(props) => props.theme.requestTabPanel.dragbar.activeBorder};
} }
} }
`; `;

View File

@ -19,7 +19,7 @@ const StyledWrapper = styled.div`
.close-icon { .close-icon {
display: none; display: none;
color: #9f9f9f; color: ${(props) => props.theme.requestTabs.icon.color};
width: 8px; width: 8px;
padding-bottom: 6px; padding-bottom: 6px;
padding-top: 6px; padding-top: 6px;
@ -27,8 +27,8 @@ const StyledWrapper = styled.div`
&:hover, &:hover,
&:hover .close-icon { &:hover .close-icon {
background-color: #eaeaea; color: ${(props) => props.theme.requestTabs.icon.hoverColor};
color: rgb(76 76 76); background-color: ${(props) => props.theme.requestTabs.icon.hoverBg};
} }
.has-changes-icon { .has-changes-icon {

View File

@ -85,7 +85,7 @@ const RequestTab = ({ tab, collection }) => {
<span className="tab-method uppercase" style={{ color: getMethodColor(method), fontSize: 12 }}> <span className="tab-method uppercase" style={{ color: getMethodColor(method), fontSize: 12 }}>
{method} {method}
</span> </span>
<span className="text-gray-700 ml-1 tab-name" title={item.name}> <span className="ml-1 tab-name" title={item.name}>
{item.name} {item.name}
</span> </span>
</div> </div>

View File

@ -1,7 +1,7 @@
import styled from 'styled-components'; import styled from 'styled-components';
const Wrapper = styled.div` const Wrapper = styled.div`
border-bottom: 1px solid var(--color-request-dragbar-background); border-bottom: 1px solid ${(props) => props.theme.requestTabs.borromBorder};
ul { ul {
padding: 0; padding: 0;
@ -28,7 +28,8 @@ const Wrapper = styled.div`
height: 38px; height: 38px;
margin-right: 6px; margin-right: 6px;
background: #f7f7f7; color: ${(props) => props.theme.requestTabs.color};
background: ${(props) => props.theme.requestTabs.bg};
border-radius: 0; border-radius: 0;
.tab-container { .tab-container {
@ -36,7 +37,7 @@ const Wrapper = styled.div`
} }
&.active { &.active {
background: #e7e7e7; background: ${(props) => props.theme.requestTabs.active.bg};
font-weight: 500; font-weight: 500;
} }
@ -60,9 +61,9 @@ const Wrapper = styled.div`
padding: 3px 0px; padding: 3px 0px;
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
color: rgb(117 117 117); color: ${(props) => props.theme.requestTabs.shortTab.color};
background-color: ${(props) => props.theme.requestTabs.shortTab.bg};
position: relative; position: relative;
background-color: white;
top: -1px; top: -1px;
> div { > div {
@ -85,8 +86,8 @@ const Wrapper = styled.div`
&:hover { &:hover {
> div { > div {
background-color: #eaeaea; background-color: ${(props) => props.theme.requestTabs.shortTab.hoverBg};
color: rgb(76 76 76); color: ${(props) => props.theme.requestTabs.shortTab.hoverColor};
border-radius: 3px; border-radius: 3px;
} }
} }

View File

@ -20,8 +20,8 @@ const StyledWrapper = styled.div`
} }
&.active { &.active {
color: #322e2c !important; color: ${(props) => props.theme.tabs.active.color} !important;
border-bottom: solid 2px var(--color-tab-active-border) !important; border-bottom: solid 2px ${(props) => props.theme.tabs.active.border} !important;
} }
} }
} }

View File

@ -3,7 +3,7 @@ import styled from 'styled-components';
const Wrapper = styled.div` const Wrapper = styled.div`
.current-workspace { .current-workspace {
margin-inline: 0.5rem; margin-inline: 0.5rem;
background-color: ${(props) => props.theme.sidebar.workspace.bg}; background-color: ${(props) => props.theme.sidebar.workspace.bg};
border-radius: 5px; border-radius: 5px;
.caret { .caret {

View File

@ -57,6 +57,10 @@ const darkTheme = {
url: { url: {
bg: '#3D3D3D', bg: '#3D3D3D',
icon: 'rgb(204, 204, 204)' icon: 'rgb(204, 204, 204)'
},
dragbar: {
border: '#444',
activeBorder: '#8a8a8a'
} }
}, },
@ -99,25 +103,29 @@ const darkTheme = {
}, },
tabs: { tabs: {
color: '',
bg: '',
borromBorder: '',
active: { active: {
color: '', color: '#ccc',
bg: '', border: '#569cd6'
borromBorder: ''
} }
}, },
requestTabs: { requestTabs: {
color: '', color: '#ccc',
bg: '', bg: '#2A2D2F',
borromBorder: '', borromBorder: '#444',
icon: {
color: '#9f9f9f',
hoverColor: 'rgb(204, 204, 204)',
hoverBg: '#1e1e1e'
},
active: { active: {
color: '', bg: '#3D3D3D'
bg: '', },
borromBorder: '' shortTab: {
color: '#ccc',
bg: 'transparent',
hoverColor: '#ccc',
hoverBg: '#3D3D3D'
} }
}, },
@ -126,7 +134,10 @@ const darkTheme = {
}, },
table: { table: {
border: '', border: '#333',
thead : {
color: 'rgb(204, 204, 204)'
}
}, },
'primary-text': '#ffffff', 'primary-text': '#ffffff',

View File

@ -57,6 +57,10 @@ const lightTheme = {
url: { url: {
bg: '#f3f3f3', bg: '#f3f3f3',
icon: '#515151' icon: '#515151'
},
dragbar: {
border: '#efefef',
activeBorder: 'rgb(200, 200, 200)'
} }
}, },
@ -99,24 +103,29 @@ const lightTheme = {
}, },
tabs: { tabs: {
color: '',
bg: '',
borromBorder: '',
active: { active: {
color: '', color: '${(props) => props.theme.tabs.active.color}',
bg: '', border: '#546de5'
borromBorder: ''
} }
}, },
requestTabs: { requestTabs: {
color: '', color: 'rgb(52, 52, 52)',
bg: '', bg: '#f7f7f7',
borromBorder: '', borromBorder: '#efefef',
icon: {
color: '#9f9f9f',
hoverColor: 'rgb(76 76 76)',
hoverBg: 'rgb(234, 234, 234)'
},
active: { active: {
color: '', bg: '#e7e7e7'
bg: '', },
borromBorder: '' shortTab: {
color: 'rgb(117 117 117)',
bg: 'white',
hoverColor: 'rgb(76 76 76)',
hoverBg: '#eaeaea'
} }
}, },
@ -125,7 +134,10 @@ const lightTheme = {
}, },
table: { table: {
border: '', border: '#efefef',
thead : {
color: '#616161'
}
}, },
'primary-text': 'rgb(52 52 52)', 'primary-text': 'rgb(52 52 52)',