Open catalinred opened 4 years ago
I don’t think this is feasible to do without custom metrics since we don’t have access to the DOM and it would be too expensive to parse the HTML via DOMParser
, but we could still measure how frequently dir
is used and on what selectors. @rviscomi correct me if I’m wrong?
@catalinred Do you think we should still pursue this by measuring dir
usage or should we axe it?
If we can measure both ‘dir’ attr from the markup and ‘direction’ property from the CSS, and depending of the resulted numbers, then we could draw some interesting conclusions here.
But if this is too cumbersome and expensive, sure, we can skip it :)
@Tiggerito added a dir
custom metric for the Markup chapter, so this should be possible.
So we just measure usage of each dir value?
Here's an example of the output for dirs:
"dirs": {
"html_dir": "ltr",
"body_nodes_dir": {
"values": {
"ltr": 1
},
"total": 1
}
},
So you can report on the values people use for the html dir attribute as well as how often it gets used within the body.
One complication is that we don't really know what CSS selectors match. We can guess in certain cases (e.g. html
or :root
, but we don't know what e.g. .foo
is. I could:
dir
values regardless of what selector they come from, ORdir
values broken down into 3 categories: a) obviously <html>
, b) obviously <body>
, c) any other selector lumped togetherThoughts?
measure dir values broken down into 3 categories: a) obviously , b) obviously
, c) any other selector lumped together
I'd say this breakdown can be helpful.
I'm interested to find out how many devs use a different
direction
in CSS compared to thedir
attribute from the markup?My guess is that the CSS
direction
property is often used for UX things like star rating or similar and has nothing to do with the actual direction of the text in the document.