Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Eclipse4/CSS/Bridge"
Line 14: | Line 14: | ||
</source> | </source> | ||
:[[File:Usage_of_color_definition.png]] | :[[File:Usage_of_color_definition.png]] | ||
+ | |||
* Using the FontDefinition in the CSS file | * Using the FontDefinition in the CSS file | ||
Line 38: | Line 39: | ||
</source> | </source> | ||
:[[File:Usage_of_font_definition_overriding_font_params.png]] | :[[File:Usage_of_font_definition_overriding_font_params.png]] | ||
+ | |||
* Overriding the ColorDefinition in the CSS file | * Overriding the ColorDefinition in the CSS file | ||
Line 68: | Line 70: | ||
</source> | </source> | ||
:[[File:Advanced_overriding_of_color_definition.png]] | :[[File:Advanced_overriding_of_color_definition.png]] | ||
+ | |||
+ | |||
+ | * Overriding the FontDefinition in the CSS file | ||
+ | <source lang="css"> | ||
+ | FontDefinition#org-eclipse-ui-workbench-TAB_TEXT_FONT { | ||
+ | font-family: 'Times'; | ||
+ | font-size: 14px; | ||
+ | } | ||
+ | |||
+ | .MPartStack.active.noFocus { | ||
+ | swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' | ||
+ | '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; | ||
+ | font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT'; | ||
+ | } | ||
+ | </source> | ||
+ | :[[File:Basic_overriding_of_font_definition.png]] | ||
+ | |||
+ | |||
+ | :Similarly to the ColorDefinition, the user is also able to update the category, label or description of the definition |
Revision as of 10:00, 14 March 2014
The CSS bridge
The main goal of the bridge is supporting the 3.x themes in the CSS style sheets. We can use the 3.x theme element definitions in our CSS file in one of the following ways:
Important! Due to some SAC parser limitations we have to replace all 'dots' in the element ids supported by the bridge with 'dashes'
- Using the ColorDefinition in the CSS file
- The ColorDefinitions are processed as the custom color values and can be use in all color related CSS proproperties, that we support
.MPartStack.active.noFocus { swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; }
- Using the FontDefinition in the CSS file
- The FontDefinitions are processed as the custom font family
.MPartStack.active.noFocus { swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; font-family: '#org-eclipse-jface-bannerfont'; }
- By default all font parameters are retrieved from the FontDefinition, but user can override the font's parameters
.MPartStack.active.noFocus { swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; font-family: '#org-eclipse-jface-bannerfont'; font-size: 7px; font-style: italic; }
- Overriding the ColorDefinition in the CSS file
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START { color: white; } .MPartStack.active.noFocus { swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; }
- The user can also modify the category, label or description of the definition. Currently we don't support the globalization of labels and descriptions
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START { color: white; category: '#org-eclipse-debug-ui-presentation'; label: 'The brand new label'; description: 'Some description'; } .MPartStack.active.noFocus { swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; }
- Overriding the FontDefinition in the CSS file
FontDefinition#org-eclipse-ui-workbench-TAB_TEXT_FONT { font-family: 'Times'; font-size: 14px; } .MPartStack.active.noFocus { swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%; font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT'; }
- Similarly to the ColorDefinition, the user is also able to update the category, label or description of the definition