Skip to content

How do you deal with dynamically inputs? #12

@nikgraf

Description

@nikgraf

First of all: amazing work!

I have seen this example by @mxstbr

const Title = styled.h1`
  font-size: 3em;
  color: ${constants.brandColor};
  margin-bottom: 0.25em;
`;

From what I understand this would generate CSS, but what would happen in this case:

const MyComponent extends React.Component {

  state = { left: 0 };

  render() {
    const FlyingBall = styled.div`
      position: absolute;
      width: 1rem;
      height: 1rem;
      left: ${this.state.left}
    `;

    return <FlyingBall />;
}

I would expect this generates only the CSS with left: 0;. Is this correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions