borodean / postcss-assets

An asset manager for PostCSS
MIT License
537 stars 32 forks source link

Rename url() function #13

Closed ai closed 9 years ago

ai commented 9 years ago

Maybe we should use special semantic asset() function instead of common url()?

borodean commented 9 years ago

@ai there is a linguistic contradiction: while url is an antonym to inline, asset isn’t.

borodean commented 9 years ago

Renamed url function would allow a coder to explicively state their intent to provide a path to resolve. Thus, errors instead of warnings could be shown, which also resolves https://github.com/borodean/postcss-assets/issues/8. Cases highlighted at https://github.com/borodean/postcss-assets/issues/8#issuecomment-72524903 wouldn’t throw warnings anymore.

The problem is how to pick a proper new name. It should be as simple as possible, yet clear. It should also be semantially similar with inline. asset doesn’t work here, because it gives no clue about what it does. It is also not highlighting it's principal opposition to the inline one.

@ai, what do you think about calling it resolve?

ai commented 9 years ago

Other idea is asset-url as in Rails. resolve looks like nice too (and shorter).