Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

CSS Values lvl 5, standard if() syntax

Offen
#1,667 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
css
Bereich
frontend, web-dev

Rechercherichtung

Beginne damit, die Spezifikation zur if()-Notation in CSS Values Level 5 zu lesen und sie mit dem bestehenden postcss-conditional-values-Plugin zu vergleichen. Das Issue nennt keine Dateien, Tests oder einen definierten Implementierungsumfang; abgeschlossen wäre die Arbeit erst, wenn vereinbart ist, ob ein neues Plugin eine nützliche Teilmenge der Standardsyntax unterstützen kann und wie dieser Umfang validiert werden sollte.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

feature request
What would you want to propose?

Spec: https://drafts.csswg.org/css-values-5/#if-notation
This is the draft for a standard conditional selector.
There is a plugin that does similar thing called postcss-conditional-values, it could either be modified to support new experimental syntax, or a new plugin could be made partly based on it.
Would be nice to have a polyfill for this in the future with the standard syntax.

Suggested solution

Spec allows media queries, and overall it is differs from postcss-conditional-values in a number of ways, so a new plugin is probably better.

Spec allows stuff like this:

.valid-if {
  --if-clause: media(width >= 600px): blue;
  color: if(...var(--if-clause); else: green;);
}

I don't think is something that can be polyfilled

Additional context

Overall this is more of a different syntax for queries, and doesn't replace postcss-conditional-values.

This request is related to https://github.com/csstools/postcss-plugins/issues/134 for some part.

Validations
  • Follow our Code of Conduct
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Would you like to open a PR for this feature?
  • I'm willing to open a PR
Vorherrschende Sprache
CSS
Sterne
1.1k
Forks
83
Ø Merge
6 Std. 43 Min.
Gemergte PRs (30 T.)
26

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus csstools/postcss-plugins

Alle Issues in csstools/postcss-plugins

Ähnliche Issues

Weitere Issues zu Web Dev

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.