Dark Theme in Eclipse Photon | The Eclipse Foundation (2024)

A few years ago, in 2014, Eclipse IDE announced that it will ship a default dark theme. In 2014, many of restrictions existed in the CSS and SWT styling of the Eclipse workspace and the result was not very usable. But the Eclipse platform team wanted to lay the foundation for improvements without the requirement to install external components to test and to drive these improvements. The releases following the initial release constantly improved the capabilities of the underlying CSS engine and the SWT toolkit to enhance the user experience.

With Eclipse Photon, we are shipping the best support for the dark theme so far. Continue to read to learn about the improvements in the platform and in the second part, how plug-in developers can enable their Eclipse contributions for the dark theme.

Try it out

Someone once said, that all the cool kids are using a dark theme these days. If you want to join this club, simply type "Dark" into the Quick Access box and press enter. This brings you to the correct preference page. Select Dark, press Apply and Close (and restart your IDE to fully apply the theme).

Dark Theme in Eclipse Photon | The Eclipse Foundation (1)

Dark Theme in Eclipse Photon | The Eclipse Foundation (2)

Selected Dark theme improvements in 4.8

Sometimes the small things do matter. Eclipse 4.8 continues to improve the default text editor. The Eclipse default dark theme now includes styling for the text editor's range indicator and uses transparency for the expand and collapse buttons.

Dark Theme in Eclipse Photon | The Eclipse Foundation (3)

To improve readability in the dark theme, bold style usage has been reduced in the Java editor and some colors that were too close to each other have been altered.

Dark Theme in Eclipse Photon | The Eclipse Foundation (4)

Lots of icons have been adjusted to look better in both the light as well as the dark theme.

For example, the block selection, word wrap and show whitespace icons have been adjusted.

Before:

Dark Theme in Eclipse Photon | The Eclipse Foundation (5)

After:

Dark Theme in Eclipse Photon | The Eclipse Foundation (6)

Popup dialogs, for example the platform's update notification popup, now use a dark background and a light foreground color in the dark theme.

Dark Theme in Eclipse Photon | The Eclipse Foundation (7)

The same work has been done for the Javadoc popup which makes the dialog much easier to read in the dark theme. Support for other languages will most likely pick this up for the next release, e.g., the PHP team is working on this in https://bugs.eclipse.org/bugs/show_bug.cgi?id=534520.

Dark Theme in Eclipse Photon | The Eclipse Foundation (8)

Links now consistently use a light blue color in the dark theme. One example where this was very visible is the PDE's manifest editor.

Dark Theme in Eclipse Photon | The Eclipse Foundation (9)

Improved Tree and Table widget scaling at high DPI on Windows

The colors of links in code element information control now take the color settings of the Hyperlink text color and the Active hyperlink text color from the Colors & Fonts preference page into account. The readability in the dark theme has been improved a lot by this.

Before:

Dark Theme in Eclipse Photon | The Eclipse Foundation (10)

After:

Dark Theme in Eclipse Photon | The Eclipse Foundation (11)

Also multiple extensions like the Gradle tooling for Eclipse have improved their styling.

For example, this is how the Gradle preference page looked before Photon.

Dark Theme in Eclipse Photon | The Eclipse Foundation (12)

This page is nicely styled in the Photon release.

Dark Theme in Eclipse Photon | The Eclipse Foundation (13)

The Gradle tooling initially designed a relatively complex solution to support the dark theme. The final solution is really simple (see https://github.com/eclipse/buildship/pull/688) and the next chapter is designed to help other plug-in developers to apply the same solution for their plug-ins.

Guide for plug-in developers to contribute to the default dark theme

Plug-in developers can easily support the dark theme as any plug-in can contribute to the default dark theme.

To contribute a CSS file to the dark theme, you can write an extension in your plugin.xml similar to the following. The refid="org.eclipse.e4.ui.css.theme.e4_dark" points to the platform dark theme and tells the CSS engine to extend it.

<extension point="org.eclipse.e4.ui.css.swt.theme"> <stylesheet uri="css/your_dark_extensions.css"> <themeid refid="org.eclipse.e4.ui.css.theme.e4_dark"> </themeid> </stylesheet> </extension>

If you have a custom control, for example MyControl, you can style it for example with the following entry in the "your_dark_extensions.css" file

MyControl { background-color:#515658; color:#eeeeee;}

If MyControl is a subclass of Control, the existing CSS handler for Control and the properties background-color and color will call its setForeground and setBackground method on instances of this widget.

As for colors and icons, plug-in developers should avoid hard-coded colors and use png icons with a transparent background to look good in the light as well as in the dark theme.

One way to allow styling of colors is to use preferences or even use the colors and fonts extension point for the platform as described in the following blog post: http://blog.eclipse-tips.com/2008/08/adding-color-and-font-preferences.html

Styling preference via CSS is very simple. Use the IEclipsePreferences#your-preference-node to select the preference node you want to set. Only replace "." with "-" for your preference node. You cannot use “.” as these have a predefined meaning in CSS. The Eclipse CSS engine will convert the underscores to the correct preference node. If styling colors and fonts from the platform extension point, you must also add a pseudo-select (in the following example :org-eclipse-jdt-ui) to avoid overridden CSS preference settings from other plug-ins.

Here is an example from JDT UI for styling its colors, which will contribute to the org.eclipse.ui.workbench preference node.

IEclipsePreferences#org-eclipse-ui-workbench:org-eclipse-jdt-ui { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */

preferences: 'org.eclipse.jdt.ui.ColoredLabels.inherited=143,143,191' 'org.eclipse.jdt.ui.Javadoc.backgroundColor=52,57,61' 'org.eclipse.jdt.ui.Javadoc.foregroundColor=238,238,238'}

Available tools for CSS work

To analyze or to test CSS snippets you can use the CSS spy and the CSS scratch pad. Install the spies via the following update site: http://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest/

The CSS spy allows the selection of a UI component and show (and sometimes) change their properties.

Dark Theme in Eclipse Photon | The Eclipse Foundation (14)

To test CSS snippets use CSS scratchpad, also available on the above update site. For example, open the “CSS Scratchpad” view via the Quick Access and use the following:

CTabFolder Composite { background-color: pink;}CTabFolder CTabItem { background-color: lime; color: green;}CTabFolder CTabItem:selected { background-color: blue; color: white;}

This will style the running IDE similar to the following.

Dark Theme in Eclipse Photon | The Eclipse Foundation (15)

Last but not least, it allows the preference spy to trace changes in the preferences to find the correct preference node and value to style it.

For more information on the spys and the CSS styling see http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#eclipse_ide_spies and http://www.vogella.com/tutorials/Eclipse4CSS/article.html.

Future work

Of course, the platform team continues to work on the dark theme. Most interesting for Windows users is the work in Bug 508634 which would allow users to set the background and foreground color for (read-only) combo-box which are frequently used in the Eclipse IDE. But again lots of small annoyances will be addressed for the next release, which will arrive only 3 months later after the Photon release.

Good news for the dark theme is that several platform developers, including the author of this article, have switched to the dark theme for their daily work. This also means that the remaining issues with the dark theme are more easily discovered and faster fixed.

How can you help as a user?

Tools like Git, Gradle, and Maven for Eclipse already provide good support for the dark theme and we expect that this support will grow in the future, especially now that plug-in developers have a small guide how to support it. Patches to support the dark theme are also relatively simple (plugin.xml registration of the CSS file and a corresponding CSS file).

So if you are a dark theme user, please open bugs for the components which do not yet support the dark theme. Or even better provide a snippet which you validated via the CSS spy or CSS scratch pad so that the plug-in developers can apply it. Also plug-ins which are still using old gifs (which do not support real transparency), will most likely be happy about contributions of svg version of their icons, so that they can generate png and HDPI png files from them.

Conclusion

So hopefully you enjoy the improved dark theme in Eclipse Photon. Like I said earlier, all the cool kids are using a dark theme these days. ;-)

About the Author

Dark Theme in Eclipse Photon | The Eclipse Foundation (2024)

FAQs

How to do dark theme in Eclipse? ›

If you want to join this club, simply type "Dark" into the Quick Access box and press enter. This brings you to the correct preference page. Select Dark, press Apply and Close (and restart your IDE to fully apply the theme).

How do I disable the dark theme in Eclipse? ›

Just navigate to Preferences > General > Appearance. Choose "Classic" for "Theme" and hit "Apply and Close". You may have to restart eclipse. Eclipse, reset Appearance: Preferences > General > Appearance, Just Restore defaults and apply/close.

How do I change the dark theme in Eclipse Luna? ›

To use the dark theme, go to Preferences -> General -> Appearance and choose 'Dark'. For more Eclipse Tips & Tricks, follow me on Twitter.

How do I change the color theme in Eclipse? ›

Colors
  1. Open the. General > Appearance > Colors and Fonts preference page.
  2. Select the color you want to change in the tree view and click the color bar on the right.
  3. Use the dialog which opens to select a color.
  4. Click OK.

How do I get dark theme mode? ›

Turn on Dark theme
  1. On your Android device, open Chrome .
  2. At the top right, tap More Settings. Theme.
  3. Choose the theme you'd like to use: System Default if you want to use Chrome in Dark theme when Battery Saver mode is turned on or your mobile device is set to Dark theme in device settings.

How do you get complete darkness in a solar eclipse? ›

People viewing the eclipse from locations where the Moon's shadow completely covers the Sun – known as the path of totality – will experience a total solar eclipse. The sky will become dark, as if it were dawn or dusk.

Can you turn off dark theme? ›

Turn Dark theme on or off in your phone's settings

Important: When you turn on Dark theme for your phone, many apps also use Dark theme. On your phone, open the Settings app. Tap Display. Turn Dark theme on or off.

Can I change Chrome to dark mode? ›

Manage Dark mode in Chrome

At the bottom right of a New Tab page, select Customize Chrome . Under “Appearance,” select either: Light : Chrome will be in a light theme. Dark : Chrome will be in a dark theme.

How do I get to Eclipse mode? ›

Eclipse is a mode of play in Shadow Fight 2 that deviates from the normal state of the game and can be activated manually. The Eclipse can be toggled by tapping the Sun found on the top right corner of the game map.

How do I change the darkest dark theme in Eclipse? ›

To change the color theme in your editor: Go to Window | Preferences | General | Appearance | Color Theme. The list of available Eclipse color themes is displayed.

How to make Dark theme using CSS? ›

Steps to create Dark-Mode websites using HTML, CSS, and JavaScript:
  1. Create an HTML document.
  2. Add CSS properties to the body and add dark-mode class properties in CSS.
  3. Add buttons to switch between Dark and Light Mode.
  4. Add functionality to buttons to switch between dark-mode and light-mode using JavaScript.
Jul 22, 2024

References

Top Articles
Tasting Table | Food, Restaurants, Reviews, Recipes, Cooking Tips
One-Pan Orzo With Spinach and Feta Recipe
Po Box 7250 Sioux Falls Sd
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Avonlea Havanese
Craigslist Kennewick Pasco Richland
Kent And Pelczar Obituaries
Chuckwagon racing 101: why it's OK to ask what a wheeler is | CBC News
What is international trade and explain its types?
House Share: What we learned living with strangers
Otr Cross Reference
What Is A Good Estimate For 380 Of 60
10 Free Employee Handbook Templates in Word & ClickUp
Mineral Wells Independent School District
Midlife Crisis F95Zone
Craftology East Peoria Il
Eva Mastromatteo Erie Pa
Mzinchaleft
Palm Coast Permits Online
NHS England » Winter and H2 priorities
Bj Alex Mangabuddy
Unity - Manual: Scene view navigation
Governor Brown Signs Legislation Supporting California Legislative Women's Caucus Priorities
Hampton University Ministers Conference Registration
Jordan Poyer Wiki
How to Make Ghee - How We Flourish
Walmart Pharmacy Near Me Open
Beaufort 72 Hour
Kroger Feed Login
4Oxfun
JVID Rina sauce set1
Marokko houdt honderden mensen tegen die illegaal grens met Spaanse stad Ceuta wilden oversteken
Ou Football Brainiacs
Miles City Montana Craigslist
Angel Haynes Dropbox
Publix Christmas Dinner 2022
Craftsman Yt3000 Oil Capacity
Motor Mounts
Kamzz Llc
4083519708
Second Chance Apartments, 2nd Chance Apartments Locators for Bad Credit
13 Fun &amp; Best Things to Do in Hurricane, Utah
Pain Out Maxx Kratom
6576771660
Here's Everything You Need to Know About Baby Ariel
Lady Nagant Funko Pop
Crigslist Tucson
Devotion Showtimes Near Showplace Icon At Valley Fair
552 Bus Schedule To Atlantic City
Diccionario De Los Sueños Misabueso
Sam's Club Fountain Valley Gas Prices
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 5999

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.