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

V14: Remove user-defined.css #16792

Merged
merged 2 commits into from
Jul 18, 2024
Merged

V14: Remove user-defined.css #16792

merged 2 commits into from
Jul 18, 2024

Conversation

iOvergaard
Copy link
Contributor

Description

These files intended that we would place them in the StaticAssets RCL and developers could overwrite them in their projects.

We need to devise a different way to do this as you cannot just overwrite assets in an RCL.

You cannot overwrite an asset in an RCL just like that, as the user-defined.css were intended.
@leekelleher leekelleher merged commit cad5502 into v14/dev Jul 18, 2024
16 checks passed
@leekelleher leekelleher deleted the v14/chore/user-defined branch July 18, 2024 12:06
@abjerner
Copy link
Contributor

abjerner commented Aug 8, 2024

Any plans for an alternative?

I was playing a bit around with adding a bit of branding to the login screen and the backoffice, and ended up hijacking the route to the CSS file as it could be overwritten as suggested by the comment in the returned file.

For now this was just me testing what was possible, but we do have a bit of branding for some of our pre-v14 sites, and I'd imagine we would need these possibilities again. I also started a thread about my exploration and findings on Discord:

https://discord.com/channels/869656431308189746/1268501698620559461

I think an extension point for adding custom CSS files would make a lot of sense. Especially if one could specify a weight or an enum location (or both) in which the CSS file would be added - e.g. before Umbraco's CSS files (like with user-defined.css) or after page load.

@iOvergaard
Copy link
Contributor Author

iOvergaard commented Sep 12, 2024

Hi @abjerner, sorry for only getting back to you now after all this time. We want to make it easier to add a stylesheet to the Backoffice than it is today. The user-defined.css file didn't work out since you had to do hijacking of the route, and it would just needlessly load the file anyway if you didn't. It goes against the principles of the Backoffice which says, you should only load the files you need.

It is supported to load a stylesheet into the Backoffice client even today, but there are a few hoops you have to jump through, namely: Register an entrypoint through a manifest and add a link tag to the header through javascript.

It makes sense DX-wise to make this easier, but I'm unsure what we need to do. We can easily make a helper function for entrypoints to add stylesheets, but from reading what you wrote here, I think we need to go a bit deeper and play around with some resemblance of what we had in the old backoffice with the css array in package.manifest, but with the addition of weights.

This calls for a discussion, which I will go ahead and start. Feel free to share your opinions here: #17049

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.

3 participants