-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Allow bundles to be rendered after all other. #4074
Conversation
@thet thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
…cluding default arguments.
82364cf
to
fb10af8
Compare
@jenkins-plone-org please run jobs |
Bundles can now depend on the automatically added "theme" and "custom" bundles from plone.app.theming and be rendered after those (e.g. after the plonetheme.barceloneta CSS). This allows to override a theme with custom CSS from a bundle instead of having to add the CSS customizations to the registry via the "custom_css" settings. As a consequence, theme customization can now be done in the filesystem in ordinary CSS files instead of being bound to a time consuming workflow which involces upgrading the registry after every change.
fb10af8
to
0a5fe7e
Compare
@jenkins-plone-org please run jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisions to mention multiple bundles with "all", and some grammar and spelling.
@@ -107,7 +107,9 @@ def check_dependencies(bundle_name, depends, bundles): | |||
valid_dependencies = [] | |||
|
|||
for name in depend_names: | |||
if name in bundles: | |||
if name in bundles or name == "all": | |||
# A valid dependency or special dependency "all", which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# A valid dependency or special dependency "all", which | |
# A valid dependency or a special dependency "all", |
if name in bundles: | ||
if name in bundles or name == "all": | ||
# A valid dependency or special dependency "all", which | ||
# specifies that the bundle should be rendered last. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# specifies that the bundle should be rendered last. | |
# meaning that all other bundles should render before these, | |
# making them the last to render. | |
# Multiple bundles with "all" will render in the order | |
# in which you declare them. |
@@ -0,0 +1,17 @@ | |||
Allow bundles to be rendered after all other. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow bundles to be rendered after all other. | |
Allow bundles to be rendered after all others. |
JS and CSS resources can now be rendered after all other resources in their | ||
resource group including the theme (e.g. the Barceloneta theme CSS). | ||
|
||
There is a exception for custom CSS which can be defined in the theming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a exception for custom CSS which can be defined in the theming | |
There is an exception for custom CSS which can be defined in the theming |
There is a exception for custom CSS which can be defined in the theming | ||
controlpanel. This one is always rendered as last style resource. | ||
|
||
To render a resource after all other give it the "depends" value of "all". This |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To render a resource after all other give it the "depends" value of "all". This | |
To render resources after all others, give them the "depends" value of "all". |
controlpanel. This one is always rendered as last style resource. | ||
|
||
To render a resource after all other give it the "depends" value of "all". This | ||
indicates that the resource depends on all other being rendered before. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicates that the resource depends on all other being rendered before. The | |
For each of these resources, "all" indicates that the resource depends on all other resources, making it render after its dependencies. |
|
||
To render a resource after all other give it the "depends" value of "all". This | ||
indicates that the resource depends on all other being rendered before. The | ||
resource is then rendered as last resource of it's resource group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource is then rendered as last resource of it's resource group. | |
If you set multiple resources with "all", then they will render in the order in which you declare them. |
indicates that the resource depends on all other being rendered before. The | ||
resource is then rendered as last resource of it's resource group. | ||
|
||
This allows to override a theme with custom CSS from a bundle instead of having |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows to override a theme with custom CSS from a bundle instead of having | |
This lets you override a theme with custom CSS from a bundle instead of having |
Close this in favor of #4077 |
This is the Plone 6.0 backport of: #4054
JS and CSS resources can now be rendered after all other resources in their
resource group including the theme (e.g. the Barceloneta theme CSS).
There is a exception for custom CSS which can be defined in the theming
controlpanel. This one is always rendered as last style resource.
To render a resource after all other give it the "depends" value of "all". This
indicates that the resource depends on all other being rendered before. The
resource is then rendered as last resource of it's resource group.
This allows to override a theme with custom CSS from a bundle instead of having
to add the CSS customizations to the registry via the "custom_css" settings.
As a consequence, theme customization can now be done in the filesystem in
ordinary CSS files instead of being bound to a time consuming workflow which
involces upgrading the custom_css registry after every change.
Docs
plone/documentation#1802
plone/documentation#1803