Finally learned how to spell CSS now I'm trying to figure out how to implement it. Had every template on page with a copy of the same CSS in it then I figured out I could put it in just one template now I'm wondering how the wizards do it. Do you (and you know who you are) have a single page with all CSS on it for the entire site or one CSS template for each page or CSS in every template?
If you do search world wide about best practices, the advise will be to have one or as less as possible minified .css
file(s)
But for dashboard (no matter 1 or 2) it is not straightforward case and it will be impractical and very hard to follow that best practice advise.
Key point I think is maintainability. Unfortunately there's no straight paths also. It depends on many things - project size, complexity and your skills are just some of them.
One thing which is often forgotten is that dashboard default CSS includes many many simple (do that one or couple things only) rules which we can/should use instead of creating our own duplicates. But to find them it takes to read and learn that CSS which for sure is not beginner level task.
Browsers like you more if you do less of CSS.
The sensible approach is to keep most if not all CSS in one place. Generally speaking, you will want every page in your app to have the same styling anyway so keeping it all together is sensible.
It also generally makes it easier for using CSS variables and calculations. Which you might want if, for example, you wanted different pages to have unique colour branding but otherwise be the same. It will also make it easier to switch between dark and light schemes.
Having separate style files may also make it harder to work out specifity and order overrides (the order in which you load the sheets makes a difference).
Of course, that isn't the only way and anything that works efficiently for you is "good".
BTW, just remember that not everything that "seems" to be a separate page is actually one. Dashboard 1 for example only had a single real page, the apparent page swaps were simply the magic of a Single Page App (SPA). D2 allows SPA's and actual pages I believe.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.