core icon indicating copy to clipboard operation
core copied to clipboard

Theming in ownCloud has conceptual errors

Open Chrissicom opened this issue 13 years ago • 3 comments

Short Explanation of Issue: When removing CSS properties in e.g. styles.css from a custom theme, these properties are still loaded from the original styles.css breaking the concept of custom themes.

Long Explanation of Issue:

I had the intention to create a clean ownCloud theme with basic functionality working in modern browsers only. This includes removing vendor specific extensions, unnecessary fancy css code and also removing alot of CSS that is not W3C standard conform.

As I understood (note: this is not how it works) the theming concept, I did the following and thought it would work:

I created a folder "../themes/mytheme/core" and added a line to the config.php "'theme' => 'mytheme'". This worked.

I then uploaded a file named styles.css to ../themes/mytheme/core/css/styles.css and thought that this file from now on will control the look and feel of the site and that the original file ../core/css/styles.css will be ignored now.

How theming really works: Actually what I did will only work as long as I change existing values (they will simply be overwritten by my value despite the original value still existing and being processed unecessarily). However when I remove just one property e.g. a vendor specific extension (there are even some IE6 hacks in the current CSS which really need to go away) "mytheme" will still contain this CSS property. Despite the property not existing in ../themes/mytheme/core/css/styles.css it will still be loaded from ../core/css/styles.css although I have configured a custom theme.

This is a conceptual error in my opinion, because it breaks the whole idea of custom themes. It essentially means you have two options:

  1. You are limited to changing existing values, but you cannot remove them, meaning that unbloating the standard theme is impossible by this method.

  2. You can replace the files in ../core/ directly instead of using the option to add a custom theme. Since this is not within the concept of theming anymore, but rather replaces ownCloud base files, this will cause more issues when upgrading to a new version.

What should be changed / made possible to fix the issue: When I create a custom theme and upload a file e.g. ../themes/mytheme/core/css/styles.css this and only this file should be used for my theme, completely ignoring the original file in ../core/css/styles.css.

This can either be made possible by changing the way theming works or by adding some override function that allows developers to let theming work the way it is now, but optionally also completely override original files and not just properties.

Chrissicom avatar Aug 16 '13 09:08 Chrissicom

@jancborchardt

karlitschek avatar Aug 16 '13 17:08 karlitschek

From http://owncloud.org/theming/:

css files are loaded additionally to the default files so you can override css properties

And that’s how it’s supposed to be. Most people just want to change the logo and the header color, but not write everything from scratch.

If you want to disable the core css styles, just remove this line: https://github.com/owncloud/core/blob/master/lib/base.php#L268

jancborchardt avatar Aug 16 '13 21:08 jancborchardt

@jancborchardt

I understand, however the feature description for "Themeing" on the page http://owncloud.org/features/ is quite misleading then. There it says "... make ownCloud look and feel like the rest of your site ..." and "... any style or image you place in this directory will be used in place of standard ...".

My understanding of this feature description was (as outlined in the first post of this issue), that e.g. styles.css in my theme directory will be used "in place of" (i.e. replacing) the standard file. What is actually true about themeing is, you can modify the existing theme but making ownCloud "look and feel like the rest of your site" is not possible with the current way themeing is implemented.

Thank you however, for pointing out where to find the relevant code bits to change this :-). I can work with this.

Chrissicom avatar Aug 17 '13 08:08 Chrissicom