-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document browser support policy based on Baseline Widely Available #301
Comments
@GrimLink Thanks for opening the issue. I'm against removing
Rather, I agree with the idea of deciding our browser support policy and documenting it. But if so, we must discuss how to decide and operate the policy. This might be a complicated discussion. 🤔 |
If we have a guiding principle, we can use our judgement case-by-case rather than have a rigid browser support policy. There are many different ways to write styles. Around 23.0.0, we geared this config towards those writing modern CSS. I think we should continue to do this, but let's explore what this means. Two groups are writing modern CSS, those writing:
We can try to cater to both groups. How's about this as a guiding principle for this config: "To help people write as modern as possible CSS without penalising those not using syntax-lowering tools" We can interpret how that's applied on a case-by-case basis by weighing up the caniuse data against the benefits of that particular syntax, e.g. does it fix a shortcoming with the older syntax or bring more consistency? This will likely mean we delay adding a rule until it has support in popular versions of evergreen browsers. Those writing very modern CSS can turn the rule on for themselves until it the syntax has broader browser support. It's a more pragmatic position than the "supported in all evergreen browsers" one we used in #275 (comment). How does that sound? |
Thanks for summing up. That makes sense to me. And adding the guideline as follows to README sounds very nice. 👍🏼
If adopting this guideline, we will need to consider caniuse.com before adding a new rule for modern syntax. For example, "Usage relative" is a good tool to do that. 👍🏼 |
Thanks for pointing out the usage relative view on caniuse. I wasn't aware of it until now. It's definitely a good tool to help us judge! |
If we ever do that, it should be an upper limit that helps us choose default values and not something that triggers the addition of rules. i.e.
That should be mentioned somewhere on https://stylelint.io/developer-guide/rules.
If we were to set the threshold at which we start our evaluation Id say something like at least 80% usage and support for these:
|
It would make sense to align this with the Baseline definition. Currently there is consensus that the Baseline definition should :
In practice it will mean that a feature must have shipped in all engines since X time or X number of versions. It is easy for users if you can say : "we use Baseline as a guide when adding new rules" because over time there will be shared understanding of what that means. The marketing pages for Baseline are outdated, but recent work can be found here : https://github.com/web-platform-dx/web-features |
updated definition for baseline : https://developer.mozilla.org/en-US/blog/baseline-evolution-on-mdn/ |
SGTM. |
media-feature-range-notation: "context
until support is betermedia-feature-range-notation: "context”
until support is beter
media-feature-range-notation: "context”
until support is betermedia-feature-range-notation: "context"
until support is beter
@romainmenke Thanks for your sharing Baseline. I agree with following the Baseline. 👍🏼 I guess we have two Baseline options, and we need to choose one from them:
Ref https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility Now, I lean toward Widely available because it allows people to learn new features. But a downside may cause lint errors in projects needing to support old browsers. This is a trade-off, but I think the benefit of telling new features wins. To prevent lint errors, people can just turn off a problematic rule. |
I would wait for the results of web-platform-dx/web-features#208 before using their definitions. |
I think the issues are outdated. |
|
@ybiquitous can you change the title of the issue? |
media-feature-range-notation: "context"
until support is beter
I just changed the issue title. |
It seems the general consensus is to adopt baseline: widely available. I've labelled this issue as a documentation change. It could be as simple as changing:
To: "It extends stylelint-config-recommended and turns on additional rules to enforce modern conventions found in the CSS specifications and within Baseline Widely Available. |
I recently updated the Fylgja Stylelint Config and was surprised to find that the rule
media-feature-range-notation: "context"
was added in v32 of stylelint-config-standard.While Safari supports the css media range syntax, support is still limited to the latest two minor versions (16.4 and 16.5) https://caniuse.com/css-media-range-syntax.
Meaning most users on iOS will not have support for this feature.
This means that anyone using v32 of stylelint-config-standard who wants to support Safari must either disable the rule or use a tool to compile their code back to the older syntax.
I'm not sure whether stylelint should add rules that are so new that they still require tools to work in all evergreen browsers. I feel that stylelint should not force users of a linting tool to use new syntax when support is still too new.
I would like to see stylelint wait until there is broader support before adding rules like this one to the config standard.
A similar suggestion was made in the issue that added this rule, #275 (comment)
Please consider:
media-feature-range-notation: "context
, until support is beter, e.g. until the next major Safari releaseThe text was updated successfully, but these errors were encountered: