How to use the polished.modularScale function in polished

To help you get started, we’ve selected a few polished examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tamiadev / tamia / src / util / typeScale.js View on Github external
return Object.keys(sizes).reduce((scale, size) => {
		// Convert to rems and remove unnecessary precision
		const value = parseFloat(modularScale(sizes[size], 1, ratio));
		scale[size] = `${Math.round(value * 1000) / 1000}rem`;
		return scale;
	}, {});
};
github fragosti / ethereum-canvas / src / components / Text.js View on Github external
  font-size: ${props => props.size !== undefined ? modularScale(props.size) : '24px'};
  ${space}
github fragosti / ethereum-canvas / src / components / Header.js View on Github external
import styled from 'styled-components';
import { modularScale } from 'polished';

import Logo from './Logo';
import { colors } from '../style/utils';


const Header = ({ className }) => (
  <header>
    
  </header>
)

export default styled(Header)`
  border-bottom: 1px solid ${colors.grayBorder};
  padding: ${modularScale(2)};
  margin: 0px auto;
  width: 100%;
`;
github component-driven / react-design-tokens / src / theme.js View on Github external
const scale = value => modularScale(value, "1rem", "goldenSection");
github smooth-code / smooth-ui / packages / shared / core / theming / typography.js View on Github external
export const fontSizeSm = thd('fontSizeSm', '1rem', s => modularScale(-1, s))
export const fontSizeLg = thd('fontSizeLg', '1rem', s => modularScale(1, s))
github arcticicestudio / nord-docs / src / styles / theme / utils / ms.js View on Github external
const ms = step => modularScale(step, `${typography.sizes.msBase}em`, typography.sizes.msName);
github FormidableLabs / react-live / demo / components / Header.js View on Github external
letter-spacing: ${polished.rem(0.3)};
  line-height: 1.5;

  @media (max-width: 600px) {
    margin-left: 0;
    margin-top: ${polished.rem(30)};
  }
`;

const StyledProjectBadge = styled(ProjectBadge)`
  height: 230px;
`;

const Title = styled.h1`
  font-weight: normal;
  font-size: ${polished.modularScale(4)};
  line-height: 1.1;
  margin: 0;
  margin-left: ${polished.rem(20)};

  @media (max-width: 600px) {
    margin-left: 0;
    margin-top: ${polished.rem(25)};
    margin-top: ${polished.rem(25)};
  }
`;

const TitleRow = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
github smooth-code / smooth-ui / packages / shared / core / theming / typography.js View on Github external
export const fontSizeLg = thd('fontSizeLg', '1rem', s => modularScale(1, s))
github fragosti / ethereum-canvas / src / components / Warning.js View on Github external
import DismissableIsland from './DismissableIsland';
import { Description, Title } from './Text';

const Warning = ({ className, error }) =&gt; (
  
    <title> Oops! 😔 </title>
    Something has gone wrong! 
    <pre>      {error}
    </pre>
   
);


export default styled(Warning)`
  padding: ${modularScale(2)};
  max-width: 700px;
  ${space}
`