Skip to content

Question: is there any way to access Passed Props? #3

@ariesshrimp

Description

@ariesshrimp

The styled-components documentation describes ways to generate styles as a function from the arguments passed to the component by consumers. For example:

const Input = styled.input`
  color: ${props => props.inputColor || "palevioletred"};
`

how does this part of the styled-components API work in ember with this package?

that is, is there a way to write code that looks like this:

// ./app/components/styled-heading/component.js
import styled from 'ember-styled-components';

const StyledHeading = styled.h1`
  font-size: 2em;
  background: ${args => args.highContrast ? 'white' : 'gray'}
`
{-- ./app/templates/application.hbs --}
<StyledHeading @highContrast={{false}}>My background is gray</StyledHeading>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions