PDA

View Full Version : Should WebApp CSS Colours be defined as Variables ?



raveens
12-Aug-2020, 12:26 AM
Hi DAW,

With DF20, it would be good if the CSS Colours in the Theme.css are defined as variables.

See: https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties

Example of usage:



:root {
--main-text-color: #000000;
--main-color-reg: #0072C6;
--main-border-color: #BABABA;
}


/* This is for the WebEdit ReadOnly */
#OWEBAPP .WebEdit.Web_ReadOnly > div > div > .WebFrm_Wrapper,
#OWEBAPP .WebEdit.Web_ReadOnly input,
#OWEBAPP .WebEdit.Web_ReadOnly select,
#OWEBAPP .WebEdit.Web_ReadOnly textarea {
color: var( --main-text-color);
}



It seems the CSS variables are supported in almost all browsers, except IE 11

Advantages
1. Changing colours in a theme would just mean updating the :root elements, instead of doing a find and replace of colours in the entire file.
2. Do not need to define separate css classes per theme in the application.css

It would also make the css generated from http://styler.dataaccess.eu/ easier to maintain and/or modified.

What do you think ?

Tom Murphy
12-Aug-2020, 12:38 AM
+1

DaveR
12-Aug-2020, 09:25 AM
+1 IE total market share is less than 3% now worldwide

Boris
13-Aug-2020, 09:50 AM
+1

Anders Ohrt
14-Aug-2020, 12:15 AM
Hi,

While it would be nice, we still have around 35% of users on IE11 so this is a no-go for us. It is steadily dropping, from over 50% 12 months ago, but at the current rate it's another 3 years before it's low enough to be unsupported for us.

Our users are moving to Chrome (~30%) and Edge (~20%). Firefox (my favorite!) is hanging in there at 2%, and "Other" (probably Safari) is at 15%.

Dennis Piccioni
14-Aug-2020, 09:34 AM
I don't know why Firefox has such a low adoption rate. Apparently, it has lost the most market share with the introduction (and forcing on Windows users) of Edge. It's been my long-time favorite, as well. It's my every day browser with all my bookmarks and other tools and I probably use it more than Outlook. Plus with it's built-in sync, I can log in on any OS and have all my bookmarks and other settings nearly instantly.

Garret Mott
14-Aug-2020, 09:42 AM
People prefer to have all their personal info tracked more thoroughly?

I too am a Firefox fan.

DaveR
18-Aug-2020, 04:20 PM
I use anything and everything, but mostly Edge and Chrome as I have a different Trello login on each.

Firefox is my go to for examining Web pages though, I have absolutely all the toys on that.