NHSLeadership / nightingale-wp

Other
1 stars 0 forks source link

Fix assets path #92

Closed Android63 closed 6 years ago

Android63 commented 6 years ago

Nightingale defines the assets path (for fonts, sprites, etc.) in _settings.definitions.scss as follows:

$asset-path: '/assets/' !default;
$font-path: '/assets/fonts/' !default;
$image-path: '/assets/img/' !default;

Which, in this case, refers to a folder that doesn't exist In the nightingale-wp folder. As a temporary workaround, we can copy the assets folder to the root of nightingale-wp, but a proper solution is needed for the longer term.

Perhaps nightingale-wp could override _settings.definitions.scss with its own definitions file...?

Android63 commented 6 years ago

@ishanivardhan I think you've solved this for Moodle. Could you point me in the right direction please?

ishanivardhan commented 6 years ago

Yes @Android63, I created _settings.pre-config.scss in same folder that has my main.scss & other middleware files

Code that goes in is:

$asset-path: '/theme/nightingale/node_modules/nightingale/assets/';
$font-path: '#{$asset-path}fonts/';
$image-path: '#{$asset-path}img/';

I have then imported this file in my main.scss for build script to use it and override config variables at run time.

Hope this helps! Let me know if you run into issues.

Android63 commented 6 years ago

Thanks @ishanivardhan. I was thinking of something along these lines. Good to be consistent.