Skip to content

Commit b4f5dfd

Browse files
committed
Add various CSS variables and fix small UI issues
1 parent 4954912 commit b4f5dfd

File tree

26 files changed

+188
-55
lines changed

26 files changed

+188
-55
lines changed

src/components/Breadcrumb/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ const ContainerBaseStyle = css`
380380
border: var(--breadcrumb-border);
381381
height: var(--breadcrumb-height);
382382
background: var(--breadcrumb-bg);
383+
box-shadow: var(--breadcrumb-shadow);
384+
border-radius: var(--breadcrumb-border-radius);
383385
`;
384386

385387
const BreadcrumbGroup = styled.div`
@@ -417,7 +419,8 @@ const ButtonCrumb = styled(BigButton)`
417419
418420
padding-left: var(--spacing-3);
419421
padding-right: var(--spacing-3);
420-
color: var(--color-text-primary);
422+
font-weight: var(--breadcrumb-font-weight);
423+
color: var(--breadcrumb-text-color);
421424
422425
overflow-x: hidden;
423426
max-width: 18.75rem;
@@ -426,6 +429,8 @@ const ButtonCrumb = styled(BigButton)`
426429
427430
&.active {
428431
background: transparent;
432+
font-weight: var(--breadcrumb-highlight-font-weight);
433+
color: var(--breadcrumb-highlight-text-color);
429434
}
430435
431436
&:hover {
@@ -437,7 +442,7 @@ const ButtonCrumb = styled(BigButton)`
437442
const BreadcrumbDivider = styled.div`
438443
display: inline-block;
439444
pointer-events: none;
440-
color: var(--color-text-primary);
445+
color: var(--breadcrumb-text-color);
441446
font-weight: bold;
442447
&:after {
443448
content: '/';
@@ -465,9 +470,11 @@ const StyledBreadcrumb = styled(ItemRow)`
465470

466471
const BreadcrumbInputWrapper = styled(InputWrapper)`
467472
${ContainerBaseStyle}
473+
box-shadow: none;
468474
`;
469475

470476
const GoToHolder = styled.div`
477+
margin-right: 0;
471478
position: relative;
472479
font-size: var(--font-size-primary);
473480
height: var(--breadcrumb-height);
@@ -480,7 +487,7 @@ const GoToContainer = styled.div`
480487
top: calc(var(--spacing-3) * -1);
481488
left: calc(var(--spacing-3) * -1);
482489
${PopoverStyles}
483-
width: 100%;
490+
width: calc(100% + var(--spacing-3));
484491
`;
485492

486493
const GotoClose = styled.div`

src/components/Button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const ButtonCSS = css`
155155

156156
const StyledButton = styled.button<StyledButtonProps>`
157157
${ButtonCSS};
158-
padding: var(--spacing-1) ${(p) => (p.iconOnly ? 'var(--spacing-1)' : 'var(--spacing-3)')};
158+
padding: ${(p) => (p.iconOnly ? 'var(--icon-button-padding)' : 'var(--button-padding)')};
159159
${(p) => getButtonColors(p.variant)};
160160
${(p) => p.active && ActiveButtonCSS};
161161
${(p) => p.disabled && DisabledButtonCSS};

src/components/Collapsable/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const Collapsable: React.FC<CollapsableProps> = ({ children, title, animated = t
3838
<CollapseContainer>
3939
<Container active={transitioning}>
4040
<CollapsableHeader
41+
open={open}
4142
onClick={() => {
4243
setTransitioning(true);
4344
setOpen(!open);
@@ -65,15 +66,16 @@ const Collapsable: React.FC<CollapsableProps> = ({ children, title, animated = t
6566
//
6667

6768
const CollapseContainer = styled.div`
68-
margin: 0.5rem 0 1rem 0;
69+
margin: var(--collapsable-margin);
6970
`;
7071

71-
const CollapsableHeader = styled.div`
72+
const CollapsableHeader = styled.div<{ open: boolean }>`
7273
display: flex;
7374
justify-content: flex-start;
75+
font-family: var(--collapsable-header-font-family);
7476
font-size: var(--font-size-primary);
75-
color: var(--collapsable-header-text-color);
7677
font-weight: 500;
78+
color: ${(p) => (p.open ? 'var(--collapsable-header-open-text-color)' : 'var(--collapsable-header-text-color)')};
7779
line-height: 1.5rem;
7880
padding: var(--collapsable-header-padding);
7981
border-bottom: var(--collapsable-header-border-bottom);

src/components/DataHeader/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const DataHeaderContainer = styled.div<{ isWide: boolean }>`
4444
font-size: var(--data-header-font-size);
4545
color: var(--data-header-text-color);
4646
margin: 0 ${(p) => (p.isWide ? 'calc(var(--layout-page-padding-x) * -1)' : '0')};
47-
padding: 1rem ${(p) => (p.isWide ? 'var(--layout-page-padding-x)' : '0.5rem')};
47+
padding: ${(p) => (p.isWide ? 'var(--data-header-padding-wide)' : 'var(--data-header-padding)')};
4848
`;
4949

5050
const DataHeaderContent = styled.div`

src/components/Form/InputLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AsyncStatus } from '../../types';
77
//
88

99
export const InputLabel = styled(ForceNoWrapText)<{ active: boolean; status?: AsyncStatus }>`
10-
background: var(--color-bg-primary);
10+
background: inherit;
1111
font-size: var(--input-label-font-size);
1212
font-weight: var(--input-label-font-weight);
1313
padding: 0 0.25rem;

src/components/Popover/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { ReactNode } from 'react';
22
import styled, { css } from 'styled-components';
3+
import InputWrapper from '../Form/InputWrapper';
34

45
//
56
// Fixed container for popups
@@ -23,6 +24,10 @@ export const PopoverStyles = css`
2324
padding: var(--popover-padding);
2425
background: var(--popover-background);
2526
border-radius: var(--popover-border-radius);
27+
28+
${InputWrapper} {
29+
background: var(--popover-background);
30+
}
2631
`;
2732

2833
export const PopoverWrapper = styled.div<{ show: boolean; alignment?: 'left' | 'right' }>`

src/components/Table/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,17 @@ export const HeaderColumn: React.FC<HeaderColumnProps> = ({
154154
>
155155
<HeaderColumnWrapper>
156156
{label}
157-
{sortable && <SortIcon active={active} direction={direction} padLeft />}
157+
{sortable && (
158+
<SortIconContainer>
159+
<SortIcon active={active} direction={direction} padLeft />
160+
</SortIconContainer>
161+
)}
158162
</HeaderColumnWrapper>
159163
</TH>
160164
);
161165
};
166+
167+
const SortIconContainer = styled.div`
168+
display: inline-flex;
169+
margin-left: var(--spacing-1);
170+
`;

src/components/Tabs/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const Tabs: React.FC<TabsProps> = ({ tabs, activeTab, widen }) => {
3737

3838
return (
3939
<TabsContainer>
40-
<Scrollbars style={{ height: '2.875rem', width: '100%' }} autoHide>
40+
<Scrollbars style={{ height: 'var(--tab-heading-height)', width: '100%' }} autoHide>
4141
<TabsHeading widen={widen}>
4242
{tabs.map((tab) =>
4343
tab.linkTo ? (
@@ -108,10 +108,12 @@ export const TabsHeadingItem = styled.div<{ active: boolean; temporary?: boolean
108108
p.active ? 'var(--tab-heading-item-active-border-bottom)' : 'var(--tab-heading-item-border-bottom)'};
109109
background: ${(p) =>
110110
p.temporary && p.active
111-
? 'var(--color-bg-secondary-highlight)'
111+
? 'var(--tab-heading-active-bg)'
112112
: p.temporary
113113
? '#f6f6f6'
114-
: 'var(--tab-heading-bg)'};
114+
: p.active
115+
? 'var(--tab-heading-active-bg)'
116+
: 'var(--tab-heading-bg)'};
115117
color: ${(p) => (p.active ? 'var(--tab-heading-active-text-color)' : 'var(--tab-heading-text-color)')};
116118
font-weight: ${(p) => (p.active ? 'var(--tab-heading-active-font-weight)' : 'var(--tab-heading-font-weight)')};
117119
cursor: pointer;

src/components/Timeline/Timeline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const StickyHeader: React.FC<{
276276
// Style
277277
//
278278

279-
const ListContainer = styled.div<{ customMinHeight: number }>`
279+
export const ListContainer = styled.div<{ customMinHeight: number }>`
280280
flex: 1;
281281
min-height: ${(p) => `${p.customMinHeight}rem`};
282282
max-width: 100%;

src/components/TitledRow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function valueToRenderableType(
8585
//
8686

8787
const StyledTitledRow = styled.div`
88-
margin: 1rem 0 0.5rem 0;
88+
margin: var(--titled-row-margin);
8989
`;
9090

9191
const TitledRowTitle = styled.div`

0 commit comments

Comments
 (0)