Skip to content

[css-pseudo][MQ][css-env] Seasonal Theming #4627

@Crissov

Description

@Crissov

Although we already have mediaqueries – drafted for level 5 – for user preferences regarding dark themes and measured environmental lightning, styling based on the userʼs seasonal and temporal surroundings can be more complex than that.

Many sites use special (content and) style during specific times of the year (and less often of the month, week or day), or in anticipation thereof. A problem with server-side approaches is that they may not be appropriate within the visitorʼs timezone, location or culture – the result can be irritating or even offensive.

  • Meteorological seasons and lunar crescents are inverted in the opposite hemisphere.
  • The time of day depends on the userʼs longitudinal location and national laws.
  • Availability of sunlight outside buildings depends on the date, (absolute) time and latitudinal location of the user.
  • Holidays depend on national laws, the calendar(s) in use, the predominant local religion or culture and that observed by the user.

I am not sure how to address this the best way in CSS, but I believe it is in scope. Environment variables, pseudo classes and media queries could provide solutions.

@media sunlit {
  {foo: bar;}
} 
:waning-crescent {foo: bar;} 
foo {bar: env(seasonal-color);} 

Fingerprinting and privacy concerns should be about as serious as for preferred languages and available fonts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions