Custom CSS app: can changes be reverted?

Hello everybody,

I am completely new to Nextcloud. Before accidentally breaking the Interface, I would like to ask if CSS changes done with the Custom CSS app can be reverted, perhaps by deleting the inserted CSS lines from the app box (located at the bottom of Administration → Theming)?

Thanks in advance


Nextcloud Hub 10 (31.0.5)
Version: 8.2.28
Memory limit: 256 MB
mysql 10.11.6

Of course!
All changes are immediately active or disappear when you remove them.
You could have tried it out first, then you would have seen the results immediately.


ernolf

I tried it out, however saw neither a change after adding CSS, nor after removing the CSS, which made me feel unsure about the whole thing.
Does or should it have an effect on all user interfaces, when the admin uses this app for manipulating the CSS? Or does it effect only the admin interface?

Which CSS do you want? What do you want to change? I’d be happy to help you create the right CSS for your needs.

That depends entirely on the CSS used. In CSS code, you can specify exactly where it will work and where it won’t. That’s exactly what makes CSS so powerful.


ernolf

Basically I’d like to strip the interface or the given possibilities for certain users (something like a guest group).
Beginning with the three icons for search, notifications and contacts at the upper right, which I would like to remove.
In the settings section I would like to strip the personal settings, by removing some fields.
I’d like to completely remove (or hide) the sharing option from the left settings menu and the device and session section for those users.
And probably more. Not sure if all or even some of this can be achieved by changing some CSS with the Custom CSS app. I can certainly try some, now that I know that everything can be undone. But a hint if all this is even doable would be well appreciated.

Yes. Also, if you really mess up the UI enough that you can’t even reach it you can use occ to clear it out. See theming_customcss: How can I recover if my customized CSS code has broken the user interface?.

Good to know. Indeed I have been able to “clean” the Personal Settings by using this CSS snippet in the app:

.personal-settings-setting-box:nth-of-type(n+4) {
  display: none;
  visibility: hidden;
}

And I could revert by deleting the code. However I am not (yet) able to achieve that these settings are applied to the UI of certain users. In the Custom CSS app settings, where it is possible to select certain groups, there seems to be a bug. Whatever I try, the selected group is not saved…

Hi @nachbar,

If you’re new to Nextcloud, you should first familiarize yourself with the concept and the existing apps before you dive right into the CSS.

The concept of Nextcloud is that it can be expanded and enhanced with apps. What you want to achieve with custom CSS is essentially writing an app that already exists.

There already exists a Guests App:

App-Id guests
App-Name Guests
Summary Create guest accounts for easier collaboration
App can not be restricted to groups
Categories security
Repository GitHub - nextcloud/guests: 🙈 Create guest users which can only see files shared with them
Issue-Tracker GitHub · Where software is built
Admin-Doc. guests/README.md at main · nextcloud/guests · GitHub
Not-shipped (not included) App available in appstore
Appstore Guests - Apps - App Store - Nextcloud

please try that first.


The apps, and Nextcloud itself, can be customized in a huge number of ways. If the guest app ultimately still doesn’t meet your expectations, you can use custom CSS to adjust the remaining details, unless there’s already a more elegant solution or a feature you haven’t discovered yet.

Given the number of requested changes, I’ll just limit myself to making sure it’s all possible.

I’ve provided many CSS hacks in the past. Check them out for yourself and see if you find something that inspires you:

https://help.nextcloud.com/search?q=%22custom%20css%22%20%40ernolf%20order%3Alatest_topic


Much and good luck,
ernolf

Yes I think the Guests App could work for me - if it worked.
Unfortunately it’s impossible for me to add a user account to the Guests group. The drop-down field simply doesn’t store ‘Guests’. I’ve clicked on it 1000 times but the field remains empty. It is however no problem to set a user account as admin for the Guests group. Which is not what I need. So there’s some kind of bug active here. Maybe the reason is my systems memory limit of 256 MB (I’m running Nextcloud on a hosting service).