havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
477 stars 67 forks source link

CSS with Bootstrap Icons Optional #567

Open DaleCam opened 1 year ago

DaleCam commented 1 year ago

I thought perhaps if we separated the bootstrap-icons css from the default.css we could have 2 css options:

  1. default.css (imports both icons and defaults from 2nd file so defaults are only in 1 place)
  2. default-excluding-icons.css (or maybe havit-defaults.css?)

This way for those of us not using bootstrap icons we could just reference the css excluding the icons. To avoid breaking default.css for all current havit users, we could move the current default.css content (excluding the icons import) into the default-excluding-icons.css and then default.css would import icons and the new default-excluding-icons.css

If you are good with this suggestion i would happily do a PR with it.

Thanks for your consideration!

hakenr commented 1 year ago

There are many other parts of the CSS which might have been stripped if not used, e.g. whole components not being used etc.

We understand you might not like the "bootstrap-icons.css" to appear in the requests made if you are not using the icons.

We might consider other techniques to make the Bootstrap icons related stuff optional, but currently the icons our "part of the core" (the BootstrapIcon class with all the icons is still there and you can use it).

...to be discussed on library design meeting.

PS: Implementation note: We definitely want to avoid maintaining two copies of the defaults.css definitions. The current content of defaults.css would have to be extracted to some defaults-core.css and @imported to defaults.css or any other technique to avoid the duplicate code would have to be used (design-time, build-time, run-time, ...?).

crdo commented 10 months ago

@hakenr i suggest we remove the icons from the defaults.css and link em in the setup from the CDN. It feels better in every way.

hakenr commented 10 months ago

@hakenr i suggest we remove the icons from the defaults.css and link em in the setup from the CDN. It feels better in every way.

This would be a major breaking-change so we can discuss this for v5 release.