-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add dictionary support for hyphens #1714
Conversation
features/hyphens.yml
Outdated
@@ -2,3 +2,8 @@ name: Hyphenation | |||
description: The `hyphens` CSS property controls when long words are broken by line wrapping. Although called `hyphens`, the property applies to word-splitting behavior across languages, such as customary spelling changes or the use of other characters to mark an intraword line break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we mention in here somewhere that the rules used for breaking up words only work for English? This way, it makes more sense why there's also a non-english hyphens feature.
chrome_android: "55" | ||
edge: "79" | ||
edge: "88" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only weird thing here is that caniuse shows Edge as fully supported only since version 105. It says this about Edge 88 to 104: "Only supported on Android & Mac platforms". I think that might be a bug on caniuse. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it looks like Caniuse is correct - Fyrd/caniuse#5793, but I can't find any mention of the issue in BCD. I think this would be a good candidate for further investigation in #1499.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is correctly captured in BCD: https://github.com/mdn/browser-compat-data/blob/542950072c56fb558dc0c7fa16215734a66196b0/css/properties/hyphens.json#L85-L129
features/non-english-hyphens.yml
Outdated
@@ -0,0 +1,67 @@ | |||
name: Non-English hyphens | |||
description: The `hyphens` CSS property uses language-specific rules to determine when long words are broken by line wrapping. The content language is set with the HTML `lang` attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this description should make it clearer that this is for non-English and that readers are supposed to have read the description for hyphens
first.
I know it's in the name, but I feel like there needs to be more of a connection between the two features somehow.
Having a see_also
field would be useful for this kind of feature. Or, perhaps, we can put them together in a new group, maybe called typography
(which would be under the CSS group).
As for the description, how about something like this: "When used with a non-English HTML lang
attribute value, the hyphens
CSS property uses language-specific rules to determine when long words are broken by line wrapping."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a
see_also
field would be useful for this kind of feature.
I agree, that would be useful.
For the description, I want to stay away from the idea that English is the default- per the spec, you should need to also specify your language as English in order to get English hyphens. As I think through this, the reason I split them apart was to tell a fuller support story, but unless we split each language into a feature, it won't be possible for someone to differentiate between French support (baseline low) and Esperanto support (none).
Because of this, I'm proposing that I combine the two into a single hyphens
feature, and adding a note that "support for non-English languages varies". While that violates the "don't mention support in the description" rule from the style guide, it does seem important to let people know. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of this, I'm proposing that I combine the two into a single hyphens feature
I agree it makes sense to merge this into a single feature, with support based on the auto
value, which is really the new functionality people are looking for in most cases. Then the description can mention the property is applied contextually based on specified language.
Ideally there would be a way to link to more context in a case like this?
If anything is split out to show specific language support, that could be done language-by-language.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've joined them in e730703
chrome_android: "55" | ||
edge: "79" | ||
edge: "88" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is correctly captured in BCD: https://github.com/mdn/browser-compat-data/blob/542950072c56fb558dc0c7fa16215734a66196b0/css/properties/hyphens.json#L85-L129
@@ -1,4 +1,73 @@ | |||
name: Hyphenation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to link to this issue from a comment, so we can return to this "support for non-English…" text later #915
Adds language support for hyphens. Pins support on the
auto
value. For more discussion, see #1714 (comment).Initial description
This naming and split seems odd, but the support story here is that `hyphens` support for English was added initially, and now support for other languages is quite spotty. Only 13 of the 60 non-English languages are baseline low.Also adds
auto
andlanguage_english
tohyphens
, which also better brings it inline with Caniuse.We should ensure that this does not communicate that English is the default language, but rather that English was the only supported language initially.