Skip to content

using css-modules exported variables? #4502

Closed
@raptoria

Description

@raptoria

Hi all, I'm new to CRA.
I see that the example boilerplate is importing the css like so,
import './App.css';

when I attempt to import the CSS as a variable, eg.
import * as styles from './App.css';

<header className="App-header" style={{background:styles.specialwhite}}>

I get the error, 'Cannot find module ./App.css'

I'm using Typescript. Any ideas on how to get this to work? I'd prefer not to use requires. I don't see .css.d.ts being generated anywhere. Is there a way to specify this without ejecting CRA and adding typed-css-modules?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions