id-sk / id-sk-frontend

ID-SK 2 Frontend contains the code you need to start building a user interface for government platforms and services.
https://idsk2.gov.sk/
MIT License
26 stars 20 forks source link

assetPath govuk and idsk #399

Open skodapetr opened 2 years ago

skodapetr commented 2 years ago

The default assets path assume there is directory with assets at /assets/.

For example /assets/images/loupe.svg . This is declared in @id-sk/frontend/idsk/components/search-results/search-results.scss as background-image: idsk-image-url("loupe.svg");. The idsk-image-urlfunction by default employs the $idsk-assets-path property. As a result changing this property to ../node_modules/@id-sk/frontend/idsk/assets/ allow a user to avoid the need to copy all the assets .... except it does not.

This cause another problem, for example 'govuk-crest.png'. This asset is used on two files:

./node_modules/@id-sk/frontend/govuk/components/footer/_footer.scss:    background-image: govuk-image-url("govuk-crest.png");
./node_modules/@id-sk/frontend/idsk/components/footer/_footer.scss:    background-image: idsk-image-url("govuk-crest.png");

While the first use can be fixed by $govuk-assets-path: "../node_modules/@id-sk/frontend/govuk/assets/" the second one can't.

The reason is that the govuk-crest.pngis not in the idsk asset file. This effectively force users to create an asset directory and copy all assets there.

A solution would be to employ the govuk function for resources from govuk and only employ idsk functions for assets in the isdk asset directory.

Another solution would be to copy all default resrouces from govuk to idsk here in the repository.

This does not apply only to images, but to all assets in general.

davidurco commented 2 years ago

364

376

372

361

365

...