Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

CSS Values lvl 5, standard if() syntax

未关闭
#1,667 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
css
领域
frontend, web-dev

调研方向

首先阅读 CSS Values Level 5 的 if() 表示法规范,并将其与现有的 postcss-conditional-values 插件进行比较。该 issue 没有指定文件、测试或明确的实现范围;要完成这项工作,需要先达成一致:新插件是否能够支持标准语法的一个有用子集,以及应如何验证这一范围。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
CSS
星标
1.1k
派生
83
平均合并
7 小时 9 分钟
30 天内合并 PR
28

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

csstools/postcss-plugins 的其他 Issue

查看 csstools/postcss-plugins 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。