How to use the @emotion/css.cx function in @emotion/css

To help you get started, we’ve selected a few @emotion/css 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 opctl / opctl / webapp / src / components / Form / index.tsx View on Github external
export default function Form(
  {
    className,
    children,
    isValid,
    onSubmit,
    submitName
  }: Props
) {
  return (
    <form
      className={
        cx(
          css({
            padding: '1.2rem'
          }),
          className
        )}
      onSubmit={e => e.preventDefault()}
    >
      {children}
      {
        <input
          // include hidden submit to ensure enter always triggers submit
          // without submit input, browsers disable submit on enter
          type='submit'
          style={{ display: 'none' }}
        />
      }
github opctl / opctl / webapp / src / components / Pill / index.tsx View on Github external
export default function Pill(
  {
    className,
    children,
    onClick
  }: Props
) {
  return (
    <div
      className={cx(
        css({
          backgroundColor: brandColors.white,
          borderRadius: '1000vh',
          border: `.1rem solid`,
          color: brandColors.active,
          cursor: 'pointer',
          display: 'inline-block',
          padding: '.8rem 1.4rem',
          textAlign: 'center'
        }),
        className
      )}
      onClick={onClick}
    >
      {
        children
github opctl / opctl / webapp / src / components / TextInput / index.tsx View on Github external
export default function TextInput(
  props: Props
) {
  return (
    <input
      {...props}
      className={cx(
        css(formElementStyles),
        css({
          backgroundColor: brandColors.white,
          color: brandColors.black,
          padding: '1rem 1.2rem',
          border: `solid .1rem ${brandColors.lightGray} !important`,
          width: '100%'
        }),
        props.className
      )}
      onChange={({ target }) => props.onChange(target.value)}
    />
  )
}
github opctl / opctl / webapp / src / components / InputGroup / index.tsx View on Github external
export default function InputGroup(props) {
  return (
    <div
      className={cx(
        css({
          width: '100%',
          marginBottom: '1rem'
        }),
        props.className
      )}
    >
      {props.children}
    </div>
  )
}
github opctl / opctl / webapp / src / components / PanelRow / index.tsx View on Github external
export default function PanelRow(
  {
    className,
    children
  }: Props
) {
  return (
    <div
      className={cx(
        css({
          backgroundColor: brandColors.white,
          borderBottom: `solid .1rem ${brandColors.reallyLightGray} !important`,
          color: brandColors.black,
          padding: '1rem 1.2rem',
          width: '100%'
        }),
        className
      )}
    >
      {children}
    </div>

  )
}
github opctl / opctl / webapp / src / components / Container / index.tsx View on Github external
export default function Container(
  {
    className,
    style,
    children
  }: Props
) {
  return (
    <div
      className={
        cx(
          css({
            padding: '1.2rem'
          }),
          className
        )
      }
      style={style}
    >
      {
        children
      }
    </div>
  )
}
github opctl / opctl / webapp / src / components / AutoComplete / index.tsx View on Github external
? renderIcon()
              : null
          }
          <input
            {...inputProps}
          />
        </div>
      }
      suggestions={options}
      shouldRenderSuggestions={
        shouldSearch
          ? shouldSearch
          : () => true
      }
      theme={{
        container: cx(
          css({
            width: '100%',
            position: 'relative'
          }),
          className
        ),
        input: css({
          ...formElementStyles,
          backgroundColor: brandColors.white,
          color: brandColors.black,
          padding: '1rem 1.2rem',
          width: '100%'
        }),
        suggestionsContainerOpen: css({
          backgroundColor: brandColors.white,
          border: `1px solid ${brandColors.lightGray}`,
github opctl / opctl / webapp / src / components / Modal / index.tsx View on Github external
export default function Modal(
  {
    children,
    className,
    isCompleteDisabled,
    isOpen,
    onComplete,
    onClose,
    title,
  }: Props
) {
  return (
    <ReactModal
      className={cx(
        css({
          '@media screen and (min-width: 600px)': {
            minWidth: '600px',
            borderRadius: '.3rem'
          },
          '@media screen and (max-width: 600px)': {
            width: '100%',
            height: '100%'
          },
          top: '50%',
          left: '50%',
          right: 'auto',
          bottom: 'auto',
          marginRight: '-50%',
          transform: 'translate(-50%, -50%)',
          position: 'absolute',
github opctl / opctl / webapp / src / components / PanelSection / index.tsx View on Github external
export default function PanelSection(props) {
  return (
    <div
      className={css({
        backgroundColor: brandColors.reallyReallyLightGray,
        paddingBottom: '1rem'
      })}
    >
      <div
        className={cx(
          commonCss,
          css({
            borderBottom: `solid .1rem ${brandColors.reallyLightGray} !important`,
            paddingBottom: '1rem',
            paddingTop: '1rem'
          })
        )}
      >
        {props.title}
        {
          props.summary &&
          <div
            className={css({
              fontSize: '.8rem'
            })}
          >

@emotion/css

The Next Generation of CSS-in-JS.

MIT
Latest version published 3 months ago

Package Health Score

84 / 100
Full package analysis