Bug 373015 - [CSS] Provide support for system theme properties in CSS
Summary: [CSS] Provide support for system theme properties in CSS
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-01 14:42 EST by Wayne Beaton CLA
Modified: 2019-11-27 07:06 EST (History)
6 users (show)

See Also:


Attachments
patch v1 (4.06 KB, patch)
2012-07-16 18:57 EDT, Brian de Alwis CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Beaton CLA 2012-03-01 14:42:11 EST
The ability to use values from the underlying operating system's theme will permit for greater fidelity with the desktop.

It would be handy to be able to specify CSS 2.1-type things along the lines of:

.MPartStack {
	font: Caption;
	background-color: HighlightText;
}

Overview: http://www.sitepoint.com/css-system-styles/
CSS 2.1 Fonts: http://www.w3.org/TR/CSS2/fonts.html#font-shorthand
CSS 2.1 System Colors: http://www.w3.org/TR/CSS2/ui.html#system-colors
Comment 1 Thomas Schindl CLA 2012-07-16 11:11:14 EDT
for the time being to at least get the Tab-Coloring right on Linux with Classic-Theme we should set a renderer on the CTabFolder which derives the color from the system to make it look like 3.x
Comment 2 Brian de Alwis CLA 2012-07-16 18:57:36 EDT
Created attachment 218778 [details]
patch v1

Exposing system colours is easy.  I've attached a first cut at to map SWT's system colors to CSS 2.1 system colors.  For example, you could use:

   #org-eclipse-ui-views-ContentOutline { background: Highlight; }
   #org-eclipse-jdt-ui-PackageExplorer { background: InfoBackground; }

(InfoBackground matches the tooltip backgrounds.)

I wasn't sure how to map the following CSS 2.1 system colors: ActiveBorder, AppWorkspace, Background, ButtonFace, ButtonHighlight, ButtonShadow, ButtonText, Menu, MenuText, ScrollBar.

Tom: I don't really see how the OS tab folder colours are exposed.  Any idea how to obtain these values?
Comment 3 Paul Webster CLA 2012-07-17 11:37:00 EDT
When doing colours in eclipse 3.x, I think a lot of variations were defined as SystemColor+10%, SystemColor+20% or something. 

Am I correct that CSS doesn't support a "relative to system font/color" syntax?

PW
Comment 4 Thomas Schindl CLA 2012-07-17 11:55:49 EDT
I was to suggest something like this. JavaFX CSS does this using 2 functions () See http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#typecolor:

derive( <color> , <number>% )
ladder(<color> , <color-stop> [, <color-stop>]+)

Their trick is quite nice because they define a base color and then allow you to reference this base-color from everywhere which means you to switch from a blue to green theme you only change 1 color and then all other colors are calculated from this base
Comment 5 Brian de Alwis CLA 2012-07-26 09:48:37 EDT
Todo: Need to also re-apply CSS on SWT.Settings event (sent when system settings change).
Comment 6 Paul Webster CLA 2013-04-08 10:39:37 EDT
See bug 402530

Does that mean this is fixed?

PW
Comment 7 Lars Vogel CLA 2019-11-27 07:06:52 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.