dart-lang / dart-pad

An online Dart editor with support for console, web, and Flutter apps
https://dartpad.dev
BSD 3-Clause "New" or "Revised" License
1.7k stars 551 forks source link

Allow users to select dark or light themes #1260

Closed galeyang closed 6 months ago

galeyang commented 5 years ago

From the user survey, one respondent would like to select the preferable color theme.

We can consider adding an option in the more menu.

jabbalaci commented 4 years ago

Is it done? This is Day 1 for me with Dart and I would like to use a light background on DartPad. Dark background is unusable for me, that hurts my eyes. How can I select light background?

repo-2017 commented 2 years ago

Light theme is a must, this should be the default as dark themes can seriously damage your vision !

jabbalaci commented 2 years ago

This issue was opened 2.5 years ago. Is adding light theme support really that difficult?

ivanzoid commented 1 year ago

TLDR: you can use this link.

As @parlough mentioned in #2166, it is possible to use light theme when embedding DartPad using iframe.

You can create local dartpad.html file and place this code to get light-themed dartpad:

<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            margin: 0;
        }
        iframe {
            display: block;
            border: none;
            height: 100vh;
            width: 100vw;
        }
    </style>
</head>
<body>
    <iframe src="https://dartpad.dev/embed-dart.html?theme=light"></iframe>
</body>
</html>

I also placed the same file to GitHub Pages, so you just can use this link: https://ivanzoid.github.io/dartpad-light/

parlough commented 6 months ago

The now-live version of DartPad outlined in https://github.com/dart-lang/dart-pad/issues/2808 now has a persistent button in the top menu to switch between light and dark themes. Thanks for all of the feedback and discussion here!

If you have any feedback around the current light and dark modes, please open an issue with specific feedback. Thanks again :D

jabbalaci commented 6 months ago

Thanks! Now, 2 years later, I can finally use that site.