Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(framework): Make addCustomCSS dynamic #2083

Merged
merged 4 commits into from
Aug 13, 2020
Merged

Conversation

vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Aug 12, 2020

The addCustomCSS API used to be static - custom styles were cached together with built-in styles and never re-evaluated (except for FF/Safari).
This change makes addCustomCSS affect already rendered components too, for all browsers:

  • addCustomCSS invalidates all cached CSS resources for the particular tag - constructable stylesheets (Chrome), style tags (IE11/Edge), and calculated effective styles (FF, Safari).
  • addCustomCSS invalidates all already rendered components with this tag.
  • All style management is now in _render rather than in _initializeContainers (basically constructor) to make it dynamic, but all style resources are now cached.

The following modules implement CSS resource caching and invalidation:

  • getEffectiveStyle
  • getConstructableStyle
  • createComponentStyleTag

To support this change, RenderScheduler.reRenderAllUI5Elements now can also invalidate based on tag.

In addition, addCustomCSS no longer displays a warning for trying to pass the theme as parameter since it's been more than a year since that change.

closes: #2079

@vladitasev vladitasev merged commit 7b54b9b into master Aug 13, 2020
@ilhan007 ilhan007 deleted the custom-css-dynamic branch August 17, 2020 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lazily applied addCustomCSS not accepted
2 participants