feat(framework): Limited support for campact size on IE #2230
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.
The goal of this change is to provide limited support for
compact
mode to IE11.Background: Compact mode is entirely dynamic. The way to achieve it is with CSS variables, defined for compact mode markers (attribute or class). Example:
The IE CSS Vars ponyfill on the other hand can only handle variables on
:root
and:host
since it needs to generate static CSS declarations.IE11 limitation:
data-ui5-compact-size
attribute, theui5-content-density-compact
class or thesapUiSizeCompact
class on the body element only.How does it work: The CSS Vars Ponyfill has the
variables
feature that lets you override some of the variables before the calculations take place. If the body has compact size set, the framework reads allstyle[data-ui5-theme-properties]
tags' content and detects the compact size variables based on the[data-ui5-compact-size]
rule, which is the official one and is mandatory. Then it passes the values of these variables to the ponyfill which effectively looks like this:Additionally, a bug on IE11 was fixed in
UI5Element.js
. On IE11 the lifecycle is a bit different and it's possible to access the listeners set before it has been defined. Therefore it's moved up in the constructor before properties upgrade.closes: #2211