NHSLeadership / nightingale-wp

Other
1 stars 0 forks source link

Asset mapping #11

Closed Android63 closed 7 years ago

Android63 commented 7 years ago

Map WordPress CSS tags to ones in Nightingale

Android63 commented 7 years ago

@chriscoffee or @cehwitham I have this working but I need some help getting my mapping file included when npm run build is executed (to generate main.css). I think it's probably a case of amending package.json, but so far I've failed to get this to work.

cehwitham commented 7 years ago

@Android63 it should be a case of @import ing the mapping.scss file into the main.scss file then it should get compiled.

Android63 commented 7 years ago

Yes, that's what I'm doing at the moment @cehwitham, but I think main.scss is part of Nightingale core and what I'm doing is specific to WordPress.

Unless we agree a convention to @import a specific file (e.g. 'css-map') from a specific folder (e.g. assets) and then, if an application needs it, we include it.

The other way would be to modify the package.json file so that the WordPress theme gets the extra file included.

cehwitham commented 7 years ago

Ok I see what you mean. So main.scss needs to remain unadulterated.

So either pull the main.scss into mapping.scss and use mapping.scss as the primary CSS file that gets delivered, or have main.scss from nightingale, mapping.scss to hold the mapping and a main.scss for WordPress but seems a bit overkill?

Android63 commented 7 years ago

There's always style.css. Maybe that could be the file used to do everything in WordPress. So style.scss references all the other files and is compiled by npm run build.

Android63 commented 7 years ago

Thanks @cehwitham and @chriscoffee for helping me get npm run build and npm run watch working