Select to view content in your preferred language

Map Tour Custom CSS Best Practices

2879
2
02-09-2016 12:28 PM
PatrickMcKinney1
Frequent Contributor

I wanted to get input on the best way to customize a self-hosted map tour.  The application includes a minified stylesheet.  I've added a custom stylesheet that relies on the use of !important to override the default stylesheet.

I am well aware this is a bad practice.  However, whenever I've copied the minified code into a un-minifyer, there is no semi-colon after the last property setting. 

I don't want to manually add-in all those semi-colons just so I can use the standard stylesheet and avoid the !important trick.

Any suggestions on how to accomplish this? I am using Komodo Edit as my text editor.

Thanks,

Patrick

0 Kudos
2 Replies
GregoryL_Azou
Deactivated User

You should not need to use !important for all your override.

This must be because your stylesheet is loaded before the app stylesheet.

One way is to put your stylesheet in index.html as documented at GitHub - Esri/map-tour-storytelling-template-js: The Story Map Tour is ideal when you want to presen...

Or you can use the loadCSS function after that point GitHub - Esri/map-tour-storytelling-template-js: The Story Map Tour is ideal when you want to presen...

I don't recommend unminifying the CSS, if you want to edit the source code of the application, follow the following guide GitHub - Esri/map-tour-storytelling-template-js: The Story Map Tour is ideal when you want to presen...  but I like better doing override in index.html or separate CSS, it makes it easier to upgrade the application

PatrickMcKinney1
Frequent Contributor

Thanks for the info Gregory.  I ended up using the loadCSS function.  I also realized some of my selectors were not specific enough.

I'm trying to improve some story maps I developed when I was less skilled with front-end languages.

0 Kudos