-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[stable25] New theming, how to make your app compatible #32060
Comments
This should be planned well. Otherwise it will slip through. |
This is still a wip, I also have another idea regarding icons, so we'll have to check if it works. |
Okay |
This comment was marked as spam.
This comment was marked as spam.
@skjnldsv as I have limited time to support my Analytics & Audioplayer app, I am looking for a compromise to support as many NC versions as possible. the usage of the following approach seems a reasonable compromise for me.
Is it possible to backport just these variables to NC24/23 also? then I could use one css to support both NC versions. |
@Rello In polls I adopted the declaration of the new variables to keep compatibility to prior nc versions. |
You can use css variables fallback https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#custom_property_fallback_values |
I don't understand what you mean by "let the Theming do its job and not try to do it yourself" in terms of the app dev requirement to support IProvidesIcons and its methods to get dedicated light/dark icons. In my app, it was set like this before:
Shouldn't this be replaced by a declarative approach, too? |
Well, apps icons are a bit more tricky, because they cannot be themed (thus the What I meant is that you should generally just use css variables as a way to themed your app, then it will automatically works and adapt to the other themes. Don't try to design your app for dark mode, just do the light mode and use the server css variables. The rest will be managed by the theming app and make your app compatible ith all the other themes automatically. |
@skjnldsv, this should rather be in dev docs, no? |
moving to milestons 25.0.1, because i don't know what else to do with the milestone… |
@skjnldsv So for custom theme compatibility when moving to NC 25, the idea would be to implement the |
@akhil1508 we do not support custom themes via |
@skjnldsv I mainly want to apply some custom styles(globally) and some app icons. Also, want to change the main colors as defined in scss variables. It used to work in Nextcloud 24. It does say in
|
if you are trying to only create a custom theme, you can adjust the css variables and have your theme as a simple app that adds its own css. regarding custom icons, depending on what you do, this might still require the use of the old legacy theming folder mechanism |
@skjnldsv Another question about customizing the look and feel. I'd like to apply styles through an app or a custom theme that can override an icon in some app. Maybe the notifications icon or the settings icon in the calendar app. Earlier, I could override a class like What is the procedure(if any) to customize icons now with all these inlined svgs? |
You cannot. This is a decision we took as the icons we are now using are very well researched and provide great readability. They are also directly compatible with our user themes. Closing now as this ticket is resolved now |
As of NC25 application has to provide their own icons, see [here](nextcloud/server#32060) The switch to NcTextField allows easy to use their wrapper for the same result than previous code Use the MDI AccountSearchIcon which feels more appropriate than a simple magnifier
…lity As of NC25 application has to provide their own icons, see [here](nextcloud/server#32060) The switch to NcTextField allows easy to use their wrapper for the same result than previous code Use the MDI AccountSearchIcon which feels more appropriate than a simple magnifier
With #31751 we decided to drop scss variables.
Not everything is compatible with css variables and you can not do colors computation anymore
Prior to 25, the theming app was providing an imperative approach with a set of css rules hacks to mitigate those dark/bright discrepancies.
With 25, we now moved to a declarative approach. There are multiple things you can/have to consider when designing an app to make sure you have a minimalistic work to do to fulfill said compatibility
That means the icons should be dark if they are over the main background and white if they are over the primary background colour
--primary-invert-if-bright
if the icon is over the primary background colour--background-invert-if-dark
if the icon is over the background colourThis will automatically invert the icon colour if necessary.
Removal of SVG colour api
With 25 we remove the support of the
icon-color
andicon-black-white
scss mixins.We move to a static generated icons colour approach #31918
While we still ask you to migrate to inline svg that automatically reflect the font colour and are compatible with any themes (like the vue material design icons), if you wtill need to use the old icons classes, you can keep doing so (until removal in the future)
.icon-more
like before or also use the css variable straight away:background-image: var(--icon-more-dark);
orbackground-image: var(--icon-more-white);
for automatic colour invert
background-image: var(--original-icon-more-white);
to force a specific colour
The text was updated successfully, but these errors were encountered: