07-23-2023, 08:53 AM
I'd been reading up on themes in my ASP.NET book and thought that it could be a very handy solution, then I met some problems.
* The theme picks up every single CSS file in the folder
* If you want to use reset styles (where ordering is important) the order of imported stylesheets is not guaranteed
* Your master page would not explicitly indicate what style is being used, only the rendered page can tell you that unless you dig into your web.config
* Styling web controls using the theme file is... well... stupid? You can simply do this in your stylesheet. Granular control should be at the HTML level, should it not?
* How do you specify print stylesheets without having all styles in a single stylesheet?
I'm wondering as to whether they're actually worth using at all. Is there any benefit? Are there any major sites using them?
**EDIT**
Just to clarify slolife's last point. If I had two stylesheets, one called print.css and one called main.css and I used ASP.NET themes, how would it know that print.css was a print stylesheet? In regular HTML you use the media type in the tag itself (i.e. `<link rel= ...>`) but the themes wouldn't know this, so it would just get included as a regular stylesheet.
* The theme picks up every single CSS file in the folder
* If you want to use reset styles (where ordering is important) the order of imported stylesheets is not guaranteed
* Your master page would not explicitly indicate what style is being used, only the rendered page can tell you that unless you dig into your web.config
* Styling web controls using the theme file is... well... stupid? You can simply do this in your stylesheet. Granular control should be at the HTML level, should it not?
* How do you specify print stylesheets without having all styles in a single stylesheet?
I'm wondering as to whether they're actually worth using at all. Is there any benefit? Are there any major sites using them?
**EDIT**
Just to clarify slolife's last point. If I had two stylesheets, one called print.css and one called main.css and I used ASP.NET themes, how would it know that print.css was a print stylesheet? In regular HTML you use the media type in the tag itself (i.e. `<link rel= ...>`) but the themes wouldn't know this, so it would just get included as a regular stylesheet.