GithubHelp home page GithubHelp logo

Set color-scheme by default about emmet HOT 5 OPEN

jimmywarting avatar jimmywarting commented on June 5, 2024
Set color-scheme by default

from emmet.

Comments (5)

sergeche avatar sergeche commented on June 5, 2024

I’m not sure if it’s something that must be added by default. I did some quick test and found that this @media only works with bare HTML page without styling. Adding background and color to :root selector forces given colors regardless of user theme. So this @media rule will fix something for unstyled pages only, which doesn’t looks real production page. Or maybe you can provide some good examples when this snippet actually provides a good styling by default?

Also, I believe that a proper dark theme or default font face is something that should be provided by developer, not a default. And Emmet allow developers to customize snippets

from emmet.

jimmywarting avatar jimmywarting commented on June 5, 2024

Or maybe you can provide some good examples when this snippet actually provides a good styling by default?

Think my jsfiddle is sufficient.

when you use color-scheme: dark then you will style the calendar widget that you can't solve with any other css selector

image

and this is what it would look without it:

image

so it's more than just default background/text color that gets applied.
And there is many styled/production ready websites that still uses native form inputs for instance.
radio boxes can still go unstyled. you get the more system OS looks and feel to them

from emmet.

sergeche avatar sergeche commented on June 5, 2024

IMO on second screenshot it matches better the default page UI. I’m not convinced such CSS should be default for simple HTML skeleton.

from emmet.

jimmywarting avatar jimmywarting commented on June 5, 2024

i haven't tried to style the page at all.

from emmet.

jimmywarting avatar jimmywarting commented on June 5, 2024

ok, turned out that you can set a meta tag as well.

<meta name="color-scheme" content="dark light">

this is actually better.

a full demo of all element is here: https://color-scheme-demo.glitch.me/
and a blog about it: https://web.dev/color-scheme/ explaining why it's a good choice to have it

from emmet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.