Closed kevinSuttle closed 8 years ago
When you leverage import
, what format are you expecting them to match?
A custom Icon Class, maybe?
Also syntax should be import { debug, api, tileView } from 'ibm-design-icons';
And if it's coupled to CSS, should leverage:
import { debug, api, tileView } from 'ibm-design-icons';
import 'ibm-design-icons/css';
Or something similar in order to allow bundlers to hook in and load the css file.
@kevinSuttle I have a script that converts the SVGs into JSX that I use for my app. I could add it to this project but this doesn't feel like the place for that
That feels more like a webpack loader to me
@mbarlock for that, yeah, I agree.
@joshblack could there be a higher-level class that uses the imports you listed as an encompassing, importable parent object?
@kevinSuttle not really, CSS needs to be handled by an appropriate loader which hooks into require
calls in webpack's case, although I'm curious how it would be handled if you could point to a css file from main
in your package.json.
If you have CSS Modules then you can totally do this api, but that requires a dependency on webpack.
No longer relevant with https://github.com/kevinSuttle/style-graph/
We should expose the icons as named exports so the import UX can match up to this: