-
Notifications
You must be signed in to change notification settings - Fork 157
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
chore: enable live reload for changes to themes #5668
chore: enable live reload for changes to themes #5668
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
SonarCloud Quality Gate failed. |
Results for oC10SharingInternalGroupsSharingIndicator https://drone.owncloud.com/owncloud/web/18259/24/1
|
Results for oC10SharingExternal https://drone.owncloud.com/owncloud/web/18259/39/1
|
This PR is ready for review, not sure how coverage is calculated in SonarCloud but this is outside the source code of the project files. |
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.
Good idea 👍🏻
@@ -0,0 +1,6 @@ | |||
Change: Enable live reload for changes to themes |
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.
Love it! Not a "Change" in terms of semver from my POV, though ;)
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.
True, changed it to enhancement
now, thanks for the hint!
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.
Good point, agreed!
Description
Owncloud has done a great job allowing customisations of themes without needing to make modifications directly to the owncloud-design-system 👍
This PR allows you to live reload in local development mode as you go through and change any theme(s) you are working on. (Eg. changing the colour of
swatch-brand-default
.)My understanding for why it does not work by default is because the application will load the theme file via fetch at runtime from the location defined in the
config.json
which, typically, would be defined as follows (on the same domain as a relative url):This content is generated from
packages/web-runtime/themes/<theme_name>/theme.json
and copied by rollup into thedist
folder, but because it's not part of the source code of the project (retrieved via fetch as opposed to static includes via TS/JS) rollup does not monitor changes to files in these folders.There may be a better way to do this so open to alternatives but this is an easy way to get the intended behaviour of real-time theme customisations, which makes it a very productive way to customise the look and feel.
Types of changes