dev/user-interface#27 - Define a "bootstrap3" bundle (skeleton) #18354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
If a page is written for the Bootstrap3 CSS vocabulary, then it should activate the corresponding bundle:
The bundle is a mix of different kinds of assets (e.g. CSS and JS).
Observe that different stakeholders interact with this bundle in different ways by :
civicrm-core
or extensions) activate the bundle (but the implementation is opaque to them).bootstrap.css
,bootstrap3.css
,greenwich.css
,greenwich-bootstrap.css
, orasset-builder?asdf1234
).This is a step toward https://lab.civicrm.org/dev/user-interface/-/issues/27. It extracts/polishes some parts of the exploratory branch #18190.
Before
There is no official contract between (a) extensions which provide Bootstrap CSS implementation and (b) extensions (or core pages) which consume the Bootstrap CSS implementation.
In the case of, say, Shoreditch, their work-around is to activate the file on every pageload, which creates other problems. Some implementers create targeted overrides just for Shoreditch's
bootstrap.css
, but this creates problems with mixing/matching. (Ex: If a CMS integrator writes an override to exclude Shoreditch'sbootstrap.css
, then that exclusion is unlikely to apply to Greenwich'sbootstrap.css
.)After
The bundle name
bootstrap3
represents a contract between different parties.Civi::resources()->addBundle('bootstrap3');
hook_civicrm_alterBundle
.bootstrap3
by some means that we're unaware of, then the entire bundle can be disabled. (Currently, this could be done with a late-priority listener forhook_civicrm_alterBundle
which calls$bundle->clear()
. We should probably expose this as a UI option as well.)Technical Details
This particular bundle is not really provided by
civicrm-core
-- core is just the middle-man who gives the namebootstrap3
. The default content is to be provided by an extension (e.g. #18190 shows this being used with a core extension "Greenwich").NOTE: Why is bundle called
bootstrap3
instead of justbootstrap
? The bundle name represents a contract between app-dev and theme-dev, but there's been confusion/debate about whether to interpret "bootstrap" as "v3" or "v4" or "v5" or "pick your own version" . This approach means:bootstrap6
orbootstrap7
. It will be possible for there to be a period where (say)bootstrap3
andbootstrap7
coexist (identified and activated separately).