How to use the @xstyled/system.th.color function in @xstyled/system

To help you get started, we’ve selected a few @xstyled/system 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 RetailMeNot / anchor / src / Skeleton / Skeleton.component.tsx View on Github external
${({ textOnly, colorStart }) =>
        textOnly
            ? css`
                  word-break: break-all;

                  color: ${colorStart};
                  animation: color-change 2s ease-in-out infinite;
              `
            : css`
                  pointer-events: none;
                  background: ${th.color(colorStart)};
                  animation: background-change 2s ease-in-out infinite;

                  // hide all children
                  && * {
                      visibility: hidden;
                      opacity: 0;
                  }
              `}
github smooth-code / smooth-ui / packages / shared / core / Card.js View on Github external
CardFooter: p => {
          const baseRadius = th.radius('base')(p)
          return css`
            padding: 0.75rem 1.25rem;
            background-color: ${th.color('highlightBackground')(p)};
            border-top: 0.0625rem solid;
            border-top-color: ${th.color('highlightBorder')(p)};

            &:last-child {
              border-radius: 0 0 calc(${baseRadius} - 1px)
                calc(${baseRadius} - 1px);
            }

            && {
              ${system(p)}
            }
          `
        },
      },
github RetailMeNot / anchor / src / List / Item / Item.component.tsx View on Github external
const StyledItem = styled('a')`
    box-sizing: border-box;
    display: flex;
    border-radius: base;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 500ms;
    ${({ background = 'white' }) =>
        css({
            background: th.color(background),
        })}
    text-decoration: none;
    height: 2.75rem;

    &:hover {
        background: ${th.color('background.light')};
    }

    &.active {
        background: ${th.color('background.base')};
    }
`;

const StyledTypography = styled(Typography)`
    display: flex;
    align-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;

    .item-prefix {
        display: flex;
github smooth-code / smooth-ui / packages / shared / core / Input.js View on Github external
padding-right: 6rpx;
            }

            &::placeholder {
              color: ${th.color('formControl.placeholder')(p)};
            }

            &:disabled {
              background-color: ${th.color('formControl.disabled.background')(
                p,
              )};
              color: ${th.color('formControl.disabled.text')(p)};
            }

            &:focus {
              ${p.theme.mixins.controlFocus(th.color('primary')(p))(p)}
            }

            &[aria-invalid='true'] {
              ${validationStyle(invalidColor)(p)};
            }

            &[aria-invalid='false'] {
              ${validationStyle(validColor)(p)};
            }

            && {
              ${system(p)};
            }
          `
        },
      },
github smooth-code / smooth-ui / packages / shared / core / Select.js View on Github external
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e")
              no-repeat right 0.75rem center/8px 10px;
            padding: ${py} ${px};
            line-height: ${th.lineHeight(`formControl.${scale}`)(p)};
            border-radius: ${th.radius(scale)(p)};
            ${safeTransition('base')(p)};

            &::placeholder {
              color: ${th.color('formControl.placeholder')(p)};
            }

            &:disabled {
              background-color: ${th.color('formControl.disabled.background')(
                p,
              )};
              color: ${th.color('formControl.disabled.text')(p)};
            }

            &:focus {
              ${p.theme.mixins.controlFocus(th.color('primary')(p))(p)}
            }

            &[aria-invalid='true'] {
              ${validationStyle(invalidColor)(p)};
            }

            &[aria-invalid='false'] {
              ${validationStyle(validColor)(p)};
            }

            && {
              ${system(p)}
github smooth-code / smooth-ui / packages / shared / core / theme / common / color.js View on Github external
teal: '#20c997',
  cyan: '#17a2b8',

  primary: th.color('brick'),
  secondary: th.color('gray600'),
  success: th.color('green'),
  info: th.color('cyan'),
  warning: th.color('yellow'),
  danger: th.color('red'),
  light: th.color('gray100'),
  dark: th.color('gray800'),

  lighter: th.color('white'),
  light100: th.color('gray100'),
  light200: th.color('gray200'),
  light300: th.color('gray300'),
  light400: th.color('gray400'),
  light500: th.color('gray500'),
  light600: th.color('gray600'),
  light700: th.color('gray700'),
  light800: th.color('gray800'),
  light900: th.color('gray900'),
  darker: th.color('black'),
  highlightBackground: p => transparentize(0.96, th.color('darker')(p)),
  highlightBorder: p => transparentize(0.875, th.color('darker')(p)),

  form: {
    valid: th.color('success'),
    invalid: th.color('danger'),
  },

  modes: {
github RetailMeNot / anchor / src / List / Item / Item.component.tsx View on Github external
${({ background = 'white' }) =>
        css({
            background: th.color(background),
        })}
    text-decoration: none;
github smooth-code / smooth-ui / packages / shared / core / Switch.js View on Github external
Switch: p => {
          const scale = p.scale || 'base'
          const width = th.size(`switch.container.width.${scale}`)(p)
          const height = th.size(`switch.container.height.${scale}`)(p)
          const ballSize = th.size(`switch.container.ball.${scale}`)(p)
          return css`
            display: inline-block;
            position: relative;
            z-index: ${th.zIndex('control')(p)};
            font-family: ${th.font('base')(p)};
            border-radius: ${th.radius('34rpx')(p)};
            width: ${width};
            height: ${height};
            background-color: ${th.color('light300')(p)};
            overflow: hidden;
            cursor: pointer;
            border-width: ${th.borderWidth(`formControl.base`)(p)};
            border-color: ${th.color('formControl.border')(p)};
            border-style: solid;
            font-size: ${th.fontSize(`switch.${scale}`)(p)};
            font-weight: ${th.fontWeight('extraBold')(p)};
            ${safeTransition('base')(p)};

            input {
              top: 0;
              left: 0;
              width: 100%;
              cursor: inherit;
              height: 100%;
              margin: 0;
github smooth-code / smooth-ui / packages / shared / core / theme / common / color.js View on Github external
success: th.color('green'),
  info: th.color('cyan'),
  warning: th.color('yellow'),
  danger: th.color('red'),
  light: th.color('gray100'),
  dark: th.color('gray800'),

  lighter: th.color('white'),
  light100: th.color('gray100'),
  light200: th.color('gray200'),
  light300: th.color('gray300'),
  light400: th.color('gray400'),
  light500: th.color('gray500'),
  light600: th.color('gray600'),
  light700: th.color('gray700'),
  light800: th.color('gray800'),
  light900: th.color('gray900'),
  darker: th.color('black'),
  highlightBackground: p => transparentize(0.96, th.color('darker')(p)),
  highlightBorder: p => transparentize(0.875, th.color('darker')(p)),

  form: {
    valid: th.color('success'),
    invalid: th.color('danger'),
  },

  modes: {
    dark: {
      lighter: th.color('black'),
      darker: th.color('white'),
      light100: th.color('gray900'),
      light200: th.color('gray800'),