Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 4x 7x 4x 4x 7x 4x 3x 4x 11x | import styled, { css, DefaultTheme } from 'styled-components'; import { media } from 'styles'; export const Container = styled.div` ${({ theme }) => css` width: 100%; display: flex; align-items: center; gap: ${theme.spacings.xsmall}; font-size: ${theme.font.sizes.medium}; flex-direction: column; ${media.greaterThan('tablet')` flex-direction: row; `} `} `; export const Label = styled.strong` flex-shrink: 0; `; export const Content = styled.div` ${({ theme }) => css` width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.3rem, 1fr)); align-content: center; gap: ${theme.spacings.xxsmall}; font-size: inherit; `} `; type OptionProps = { selected?: boolean; }; const optionModifiers = { selected: (theme: DefaultTheme) => css` background: ${theme.colors.primary}; color: ${theme.colors.bg}; font-weight: ${theme.font.weights.bold}; `, }; export const Option = styled.button<OptionProps>` ${({ theme, selected }) => css` border: 0; border-radius: ${theme.border.radius}; background: none; padding-block: 0.4rem; border: 1px solid ${theme.colors.primary}; text-transform: capitalize; font-size: ${theme.font.sizes.xsmall}; ${selected && optionModifiers.selected(theme)} ${media.greaterThan('mobile')` font-size: ${theme.font.sizes.medium}; `} `} `; |