IBM-Design / icons

IBM Design Language Icons
http://www.ibm.com/design/language/resources/icon-library
Other
194 stars 41 forks source link

Named ES2015 export properties for À la carte consumption #39

Closed kevinSuttle closed 8 years ago

kevinSuttle commented 8 years ago

We should expose the icons as named exports so the import UX can match up to this:

import { debug, api, tile-view } from 'ibm-design-icons'; 
joshblack commented 8 years ago

When you leverage import, what format are you expecting them to match?

kevinSuttle commented 8 years ago

A custom Icon Class, maybe?

joshblack commented 8 years ago

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.

barlock commented 8 years ago

@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

barlock commented 8 years ago

That feels more like a webpack loader to me

kevinSuttle commented 8 years ago

@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?

joshblack commented 8 years ago

@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.

kevinSuttle commented 8 years ago

No longer relevant with https://github.com/kevinSuttle/style-graph/