Skip to content

css() isn't picking up pseudo-selector styles defined in emotion css prop #19

Description

@kevinSuttle

Is there something I'm missing?

css={css({':focus': {borderColor: 'blue20'}}

Image 2019-05-03 at 11 25 45 AM

This is being used on a <Flexbox /> component built in @emotion/styled + styled-system.

// @flow

import styled from '@emotion/styled';

import {
  alignItems,
  alignContent,
  justifyContent,
  justifyItems,
  flexWrap,
  flexBasis,
  flexDirection,
  flex,
  justifySelf,
  alignSelf,
  order,
} from 'styled-system';
import shouldForwardProp from '@styled-system/should-forward-prop';

import {Box} from './Box';

export const Flexbox = styled(Box, {
  shouldForwardProp,
})(
  {
    boxSizing: 'border-box',
    display: 'flex',
    label: 'flexbox-primitive',
  },
  alignItems,
  alignContent,
  justifyContent,
  justifyItems,
  flexWrap,
  flexBasis,
  flexDirection,
  flex,
  justifySelf,
  alignSelf,
  order
);

What's odd is that I can get it to work here: https://stackblitz.com/edit/react-zzznyy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions