font-weight: 400 -> theme.fontWeightNormal (#4339)

* font-weight: 400 -> theme.fontWeightNormal

* Less lazy, font-weight: 400 converted
This commit is contained in:
Jaco Greeff 2021-01-09 09:41:13 +01:00 committed by GitHub
parent b16d9aac05
commit 10ce7a40e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 62 additions and 47 deletions

View File

@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/app-accounts authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from '@polkadot/react-components/types';
import React from 'react';
import styled from 'styled-components';
@ -38,7 +40,7 @@ function Balances ({ address, className }: Props): React.ReactElement<Props> | n
);
}
export default React.memo(styled(Balances)`
export default React.memo(styled(Balances)(({ theme }: ThemeProps) => `
.balanceExpander {
.column.column--expander {
width: auto;
@ -46,7 +48,7 @@ export default React.memo(styled(Balances)`
label {
color: inherit;
font-size: 0.93rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
.ui--Expander-content .ui--FormatBalance-value {
@ -54,4 +56,4 @@ export default React.memo(styled(Balances)`
}
}
}
`);
`));

View File

@ -217,7 +217,7 @@ export default React.memo(styled(FullSidebar)(({ theme }: ThemeProps) => `
width: 100%;
.th {
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
text-align: right;
flex-basis: 20%;

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { ActionStatus } from '@polkadot/react-components/Status/types';
import type { ThemeProps } from '@polkadot/react-components/types';
import type { CreateResult } from '@polkadot/ui-keyring/types';
import type { KeypairType } from '@polkadot/util-crypto/types';
import type { ModalProps } from '../types';
@ -475,7 +476,7 @@ function Create ({ className = '', onClose, onStatusChange, seed: propsSeed, typ
);
}
export default React.memo(styled(Create)`
export default React.memo(styled(Create)(({ theme }: ThemeProps) => `
.accounts--Creator-advanced {
margin-top: 1rem;
overflow: visible;
@ -503,8 +504,8 @@ export default React.memo(styled(Create)`
margin: 0.8rem 0;
> label {
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
}
}
`);
`));

View File

@ -76,7 +76,7 @@ export default React.memo(styled(DayHour)(({ theme }: ThemeProps) => `
.hourLabel {
flex: 0;
font-size: 0.85rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
line-height: 1;
min-width: 5.5rem;
opacity: 0.5;
@ -88,7 +88,7 @@ export default React.memo(styled(DayHour)(({ theme }: ThemeProps) => `
&.hasItems .hourLabel {
font-size: 1.1rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
opacity: 1;
padding: 0.7rem 1rem;
}

View File

@ -1,6 +1,7 @@
// Copyright 2017-2021 @polkadot/app-calendar authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from '@polkadot/react-components/types';
import type { DateState, EntryInfo } from './types';
import React, { useMemo, useRef } from 'react';
@ -82,7 +83,7 @@ function Month ({ className, hasNextMonth, lastDay, now, scheduled, setDay, setN
);
}
export default React.memo(styled(Month)`
export default React.memo(styled(Month)(({ theme }: ThemeProps) => `
flex: 0;
max-width: max-content;
@ -110,7 +111,7 @@ export default React.memo(styled(Month)`
.dayOfWeek {
> * {
font-size: 0.7em;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
letter-spacing: 0.1em;
text-align: center;
text-transform: uppercase;
@ -124,4 +125,4 @@ export default React.memo(styled(Month)`
justify-content: space-between;
}
}
`);
`));

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { AbiConstructor, AbiMessage, ContractCallOutcome } from '@polkadot/api-contract/types';
import type { ThemeProps } from '@polkadot/react-components/types';
import React, { useCallback } from 'react';
import styled from 'styled-components';
@ -100,7 +101,7 @@ function Message ({ className = '', index, lastResult, message, onSelect }: Prop
);
}
export default React.memo(styled(Message)`
export default React.memo(styled(Message)(({ theme }: ThemeProps) => `
align-items: center;
border-radius: 0.25rem;
display: flex;
@ -118,7 +119,7 @@ export default React.memo(styled(Message)`
.docs {
font-size: 0.9rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
}
@ -129,4 +130,4 @@ export default React.memo(styled(Message)`
&+& {
margin-top: 0.5rem;
}
`);
`));

View File

@ -80,7 +80,7 @@ function MessageSignature ({ className, message: { args, identifier, isConstruct
export default React.memo(styled(MessageSignature)(({ theme }: ThemeProps) => `
font: ${theme.fontMono};
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
flex-grow: 1;
.ui--MessageSignature-mutates {
@ -91,7 +91,7 @@ export default React.memo(styled(MessageSignature)(({ theme }: ThemeProps) => `
.ui--MessageSignature-name {
color: #2f8ddb;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
.ui--MessageSignature-type {

View File

@ -1,6 +1,7 @@
// Copyright 2017-2021 @polkadot/app-explorer authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from '@polkadot/react-components/types';
import type { KeyedEvent } from '@polkadot/react-query/types';
import type { BlockNumber, Extrinsic } from '@polkadot/types/interfaces';
@ -102,7 +103,7 @@ function ExtrinsicDisplay ({ blockNumber, className = '', events, index, value }
);
}
export default React.memo(styled(ExtrinsicDisplay)`
export default React.memo(styled(ExtrinsicDisplay)(({ theme }: ThemeProps) => `
.explorer--BlockByHash-event+.explorer--BlockByHash-event {
margin-top: 0.75rem;
}
@ -117,6 +118,6 @@ export default React.memo(styled(ExtrinsicDisplay)`
.explorer--BlockByHash-unsigned {
opacity: 0.6;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
`);
`));

View File

@ -1,6 +1,7 @@
// Copyright 2017-2021 @polkadot/app-poll authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from '@polkadot/react-components/types';
import type { Approvals, Balance, BlockNumber } from '@polkadot/types/interfaces';
import type { ITuple } from '@polkadot/types/types';
@ -202,7 +203,7 @@ function PollApp ({ basePath, className }: Props): React.ReactElement<Props> {
);
}
export default React.memo(styled(PollApp)`
export default React.memo(styled(PollApp)(({ theme }: ThemeProps) => `
.pollActions {
opacity: 0.75;
}
@ -257,7 +258,7 @@ export default React.memo(styled(PollApp)`
.optionName {
font-size: 1.2rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
line-height: 1;
margin-bottom: 0.75rem;
}
@ -287,7 +288,7 @@ export default React.memo(styled(PollApp)`
.ui--FormatBalance {
font-size: 1.2rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
line-height: 1;
}
@ -295,4 +296,4 @@ export default React.memo(styled(PollApp)`
margin: 0.75rem;
}
}
`);
`));

View File

@ -203,7 +203,7 @@ export default React.memo(styled(AccountName)(({ theme }: ThemeProps) => `
.name {
align-items: center;
display: inline-flex;
font-weight: 400 !important;
font-weight: ${theme.fontWeightNormal} !important;
filter: grayscale(100%);
line-height: 1;
opacity: 0.6;

View File

@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/app-parachains authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from './types';
import React from 'react';
import styled from 'styled-components';
@ -33,7 +35,7 @@ function AvatarItem ({ children, className = '', icon, isBig, subtitle, title }:
);
}
export default React.memo(styled(AvatarItem)`
export default React.memo(styled(AvatarItem)(({ theme }: ThemeProps) => `
& {
display: flex;
align-items: center;
@ -66,7 +68,7 @@ export default React.memo(styled(AvatarItem)`
flex: 1;
.ui--AvatarItem-title {
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
font-size: 1rem;
}
@ -96,4 +98,4 @@ export default React.memo(styled(AvatarItem)`
}
}
}
`);
`));

View File

@ -139,7 +139,7 @@ export default React.memo(styled(CardSummary)(({ theme }: ThemeProps) => `
.isSecondary {
font-size: 1rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
.timer {
min-width: 8rem;

View File

@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from './types';
import React from 'react';
import styled from 'styled-components';
@ -45,7 +47,7 @@ function Labelled ({ className = '', children, help, isFull, isHidden, isOuter,
);
}
export default React.memo(styled(Labelled)`
export default React.memo(styled(Labelled)(({ theme }: ThemeProps) => `
&.ui--Labelled {
display: block;
position: relative;
@ -101,7 +103,7 @@ export default React.memo(styled(Labelled)`
.labelExtra {
color: rgba(78, 78, 78, .85);
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
right: 1.75rem;
text-align: right;
}
@ -155,4 +157,4 @@ export default React.memo(styled(Labelled)`
}
}
}
`);
`));

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { IconName } from '@fortawesome/fontawesome-svg-core';
import type { ThemeProps } from '../types';
import type { QueueStatus, QueueTx, QueueTxStatus } from './types';
import React, { useCallback, useContext, useEffect, useState } from 'react';
@ -202,7 +203,7 @@ function Status ({ className = '' }: Props): React.ReactElement<Props> | null {
);
}
export default React.memo(styled(Status)`
export default React.memo(styled(Status)(({ theme }: ThemeProps) => `
display: inline-block;
position: fixed;
right: 0.75rem;
@ -239,7 +240,7 @@ export default React.memo(styled(Status)`
padding: 0.5rem 1rem;
.status {
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
.ui--AddressMini {
@ -305,4 +306,4 @@ export default React.memo(styled(Status)`
}
}
}
`);
`));

View File

@ -28,7 +28,7 @@ export default React.memo(styled(Foot)(({ theme }: ThemeProps) => `
td {
color: rgba(${theme.theme === 'dark' ? '254, 240, 240' : '78, 78, 78'}, 0.66);
font: ${theme.fontSans};
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
padding: 0.75rem 1rem 0.25rem;
text-align: right;
vertical-align: baseline;

View File

@ -54,7 +54,7 @@ export default React.memo(styled(Head)(({ theme }: ThemeProps) => `
th {
font: ${theme.fontSans};
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
padding: 0.75rem 1rem 0.25rem;
text-align: right;
vertical-align: baseline;

View File

@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ThemeProps } from './types';
import React, { useState } from 'react';
import styled from 'styled-components';
@ -40,12 +42,12 @@ function Tag ({ className = '', color = 'grey', hover, isTag = true, label, size
);
}
export default React.memo(styled(Tag)`
export default React.memo(styled(Tag)(({ theme }: ThemeProps) => `
border-radius: 0.25rem;
color: #fff;
display: inline-block;
font-size: 0.78571429rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
line-height: 1;
margin: 0.125rem;
padding: 0.5833em 0.833em;
@ -115,4 +117,4 @@ export default React.memo(styled(Tag)`
transition: none;
}
}
`);
`));

View File

@ -370,7 +370,7 @@ export default createGlobalStyle<Props & ThemeProps>(({ theme, uiHighlight }: Pr
display: block;
font: ${theme.fontSans};
font-size: 1rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
main {

View File

@ -117,7 +117,7 @@ export default (theme: ThemeDef): string => `
.ui.label {
background: transparent;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
position: relative;
z-index: 1;
}
@ -146,7 +146,7 @@ export default (theme: ThemeDef): string => `
color: ${theme.colorSummary};
font: ${theme.fontSans};
font-size: 1.75rem;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
line-height: 1.25rem;
padding: 1.5rem 1.75rem 0;
text-transform: lowercase;
@ -158,7 +158,7 @@ export default (theme: ThemeDef): string => `
.description {
margin: 1.5em 0;
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
}

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { QueueTx } from '@polkadot/react-components/Status/types';
import type { ThemeProps } from '@polkadot/react-components/types';
import BN from 'bn.js';
import React from 'react';
@ -61,7 +62,7 @@ function Transaction ({ className, currentItem: { accountId, extrinsic, isUnsign
);
}
export default React.memo(styled(Transaction)`
export default React.memo(styled(Transaction)(({ theme }: ThemeProps) => `
.tx-details {
.ui--Expander-summary {
font-size: 1.1rem;
@ -69,7 +70,7 @@ export default React.memo(styled(Transaction)`
}
.highlight {
font-weight: 400;
font-weight: ${theme.fontWeightNormal};
}
.meta {
@ -81,4 +82,4 @@ export default React.memo(styled(Transaction)`
opacity: 0.6;
}
}
`);
`));