2

I am building a desktop application that uses HTML, CSS and javascript, using the Electron framework. My application has the ability to let the user add a CSS file to style the application, the way they want it.

I also provide a separate window for letting the users change more aspects of the application(without the need of writing CSS).

They can change the following things:

  • Background color
  • Text color
  • Font size
  • Backgound image

Now my question is, what should take precedence over the other? Should I let the user settings be overridden by the applied CSS file or should the CSS file be overridden by the user settings?

3

User settings should take precedence over the defaults.

This makes sure that whenever a user wants to default single settings, they can do so by removing the rule from their CSS file. This is actually how CSS already works in browsers (site CSS takes precedence over any browser style sheet choices)

Secondly. Consider a different use case. Sublime Text settings for syntax formatting. When you open up Syntax specific settings you are presented with a view in two panes. Left are the defaults and recommended is changing the right hand for any syntax specific stuff. Adding rules on the right take precedence on the left. Removing them from the right essentially sets them back to the default.

Sublime Text 3 Syntax specific settings

Then you never have to worry about baked in defaults or having to reset them, they will gracefully fall back any time a rule is not present.

1

You should always give the user the feeling that their settings and customization is top priority. But having said so, it is important as an admin of your page, to retain the original theme of your website. If you ask me, I would suggest you to retain the default theme, and store it in a function, which can be accessible and can be applied on the page, when a button like 'Set Default Theme' is triggered, using javascript. That way, you let the user styles seem like they override the default theme, but you still maintain an underlying control of the layout properties of the website you built.

  • 2
    That's not really how I understand the question though. The way it sounds, the user has the ability to apply their own CSS to the app AND have the ability to change styles through in-app customisation. Both of these would override the default theme, but if they set their buttons to be Blue in the custom CSS but then use the in-app perefernces to set buttons to Red, what colour should those buttons actually be? – JonW Sep 21 '17 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.