How to use the @xstyled/styled-components.up function in @xstyled/styled-components

To help you get started, we’ve selected a few @xstyled/styled-components 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 gregberge / svgr / website / src / components / playground / SettingsGroup.js View on Github external
import styled, { up, css, Box } from '@xstyled/styled-components'
import { useHiddenState, Hidden, HiddenDisclosure } from 'reakit/Hidden'
import { ChevronLeft } from 'components/playground/icons/ChevronLeft'

const Container = styled.div`
  border-right: 1px solid;
  border-color: light400;
`

const Marker = styled(ChevronLeft)`
  width: 18;
  height: 18;
  transition: base;
  transform: rotate(90deg);

  ${up(
    'md',
    css`
      transform: rotate(0);
    `,
  )}
`

const Button = styled.buttonBox`
  font-size: 15;
  font-weight: bold;
  padding: 8 16;
  background-color: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  transition: base;
github gregberge / svgr / website / src / components / playground / Settings.js View on Github external
import { SettingsFieldBoolean } from './SettingsFieldBoolean'
import { SettingsGroup } from './SettingsGroup'
import { SettingsFieldString } from './SettingsFieldString'
import { SettingsFieldEnum } from './SettingsFieldEnum'
import { SettingsFieldInteger } from './SettingsFieldInteger'

const SettingsContainer = styled.div`
  width: 100%;
  font-size: 14;
  background-color: light100;
  color: light800;
  user-select: none;
  overflow: auto;
  max-height: 50%;

  ${up(
    'md',
    css`
      width: 200px;
      height: 100%;
      max-height: 100%;
    `,
  )}
`

const getGroupSettings = (group, settings) =>
  settings.filter(setting => setting.group === group)

const settingComponents = {
  boolean: SettingsFieldBoolean,
  string: SettingsFieldString,
  enum: SettingsFieldEnum,
github gregberge / gregberge.com / src / containers / Newsletter.js View on Github external
import React from 'react'
import styled, { Box, up, css } from '@xstyled/styled-components'
import jsonp from 'jsonp'
import { Form } from 'react-final-form'
import { FORM_ERROR } from 'final-form'
import { Container } from '../components/Container'
import { useLangKey } from '../components/I18nContext'
import { useMustBeEmail, InputField, Button } from '../components/Form'

export const FormLayout = styled.div`
  display: flex;
  flex-direction: column;
  margin: -2 -3;

  ${up(
    'md',
    css`
      flex-direction: row;
    `,
  )}
`

const Teaser = styled.h2`
  font-size: 26;
  font-weight: 500;
  color: lighter;
  margin: 4 0;
`

const Success = styled.div`
  text-align: center;
github gregberge / gregberge.com / src / containers / Hero.js View on Github external
font-family: monospace;
  font-size: 16;
  margin: 0;
  color: accent;
`

export const HeroTitle = styled.h1`
  margin: 0;
  font-size: 40;
  font-weight: 700;

  strong {
    color: lighter;
  }

  ${up(
    'md',
    css`
      font-size: 70;
    `,
  )}
`

export const HeroTeaser = styled.p`
  margin: 4 0;
  font-size: 20;
  max-width: 560;
`

export function Hero({ children }) {
  return (
github gregberge / gregberge.com / src / components / Burger.js View on Github external
&[aria-expanded='true'] {
    span {
      :first-child {
        transform: translateY(${th.px('6rpx')}) rotate(45deg);
      }
      :nth-child(2) {
        opacity: 0;
        transform: translateX(${th.px(10)});
      }
      :nth-child(3) {
        transform: translateY(${th.px('-6rpx')}) rotate(-45deg);
      }
    }
  }

  ${up(
    'md',
    css`
      display: none;
    `,
  )}
`

export const Burger = React.forwardRef((props, ref) => {
  return (
    
      <span>
      <span>
      <span>
    </span></span></span>
  )
})
github gregberge / gregberge.com / src / containers / About.js View on Github external
import React from 'react'
import Img from 'gatsby-image'
import styled, { up, css } from '@xstyled/styled-components'
import { Container } from '../components/Container'

export const AboutContainer = styled.div`
  max-width: 1000;
  margin: 0 auto;
  padding: 120 0 5;

  ${up(
    'md',
    css`
      padding-top: 8;
    `,
  )}
`

export const AboutText = styled(Container)`
  margin-top: 5;

  p {
    font-size: 18;
    line-height: 1.6;
    text-align: justify;

    a {
github gregberge / gregberge.com / src / components / Form.js View on Github external
&:hover:not(:disabled) {
    border-color: light400;
  }

  &:focus {
    outline: none;
    box-shadow: ${th.color('shadow')} 0 0 0 ${th.space(1)};
    border-color: accent;
  }

  &:disabled {
    cursor: default;
    opacity: 0.5;
  }

  ${up(
    'md',
    css`
      margin-top: 0;
    `,
  )}
`

const locales = {
  en: {
    required: 'Required',
    invalidEmail: 'Invalid Email',
  },
  fr: {
    required: 'Requis',
    invalidEmail: 'Email invalide',
  },
github gregberge / svgr / website / src / components / playground / Playground.js View on Github external
${up(
    'md',
    css`
      flex-direction: row;
    `,
  )}
`

const PlaygroundEditors = styled(Box)`
  display: flex;
  flex: 1;
  flex-direction: row;
  background-color: lighter;
  height: 50%;

  ${up(
    'md',
    css`
      height: 100%;

      > :first-child {
        border-right: 1px solid;
        border-color: light400;
      }
    `,
  )}
`

const FloatingAd = styled.div`
  position: absolute;
  bottom: 16;
  right: 16;
github gregberge / gregberge.com / src / pages / workshops.js View on Github external
to {
    transform: translate(20%, -32%) perspective(200px) rotate(-5deg) rotateY(-5deg) scale(0.95);
  }
`

const Logo = styled(AdvancedReactLogo)`
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: auto;
  transform: translate(20%, 30%);
  animation: ${rotation} 5s ease-in-out infinite;
  animation-direction: alternate-reverse;

  ${up(
    'md',
    css`
      animation-name: ${rotationMd};
    `,
  )}
`

const WorkshopTitle = styled.h2`
  margin: 0;
  font-size: 50;
  color: lighter;
`

const ClientLogoImg = styled(Img)`
  &.mode-dark {
    filter: brightness(0) invert(1);
github gregberge / gregberge.com / src / components / Navbar.js View on Github external
export const NavbarLink = styled.a`
  display: block;
  margin: 3 3;
  font-size: 20;
  font-weight: 500;
  color: lighter;
  transition: base;

  &:focus,
  &:hover {
    color: accent;
    outline: none;
  }

  ${up(
    'md',
    css`
      margin: 0 3;
      font-size: 18;
    `,
  )}
`

const MobileMenuContainer = styled.div`
  position: fixed;
  background-color: navbar-bg;
  backdrop-filter: blur(8px);
  top: 60;
  right: 0;
  bottom: 0;
  left: 0;