Skip to content
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

direction CSS property usage #38

Open
catalinred opened this issue Jul 22, 2020 · 8 comments
Open

direction CSS property usage #38

catalinred opened this issue Jul 22, 2020 · 8 comments
Labels
✅ Has algorithm (1/3) An implementable algorithm for how to measure this stat has been described in the issue ✅ Has JS (2/3) JS has been written to calculate this stat ✅ Has SQL (3/3) BigQuery SQL has been written to calculate this stat. proposed stat Proposed statistic to study Section: i18n

Comments

@catalinred
Copy link
Collaborator

I'm interested to find out how many devs use a different direction in CSS compared to the dir 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.

@catalinred catalinred added the proposed stat Proposed statistic to study label Jul 23, 2020
@LeaVerou LeaVerou added ⚠️ Needs SQL Needs SQL to calculate this stat ⚠️ Needs JS Needs JS to calculate this stat ⚠️ Needs algorithm labels Aug 4, 2020
@LeaVerou
Copy link
Owner

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?

@LeaVerou
Copy link
Owner

@catalinred Do you think we should still pursue this by measuring dir usage or should we axe it?

@catalinred
Copy link
Collaborator Author

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 :)

@rviscomi
Copy link
Collaborator

@Tiggerito added a dir custom metric for the Markup chapter, so this should be possible.

@LeaVerou
Copy link
Owner

So we just measure usage of each dir value?

@Tiggerito
Copy link

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.

@LeaVerou LeaVerou added ✅ Has algorithm (1/3) An implementable algorithm for how to measure this stat has been described in the issue and removed ⚠️ Needs algorithm labels Aug 22, 2020
@LeaVerou
Copy link
Owner

LeaVerou commented Sep 20, 2020

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:

  • store all distinct CSS selectors that these values are found on, and hope that they'd aggregate nicely over the website corpus, OR
  • just measure dir values regardless of what selector they come from, OR
  • measure dir values broken down into 3 categories: a) obviously <html>, b) obviously <body>, c) any other selector lumped together

Thoughts?

@catalinred
Copy link
Collaborator Author

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.

LeaVerou added a commit that referenced this issue Sep 21, 2020
@LeaVerou LeaVerou added ✅ Has JS (2/3) JS has been written to calculate this stat and removed ⚠️ Needs JS Needs JS to calculate this stat labels Sep 21, 2020
@rviscomi rviscomi added ✅ Has SQL (3/3) BigQuery SQL has been written to calculate this stat. and removed ⚠️ Needs SQL Needs SQL to calculate this stat labels Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Has algorithm (1/3) An implementable algorithm for how to measure this stat has been described in the issue ✅ Has JS (2/3) JS has been written to calculate this stat ✅ Has SQL (3/3) BigQuery SQL has been written to calculate this stat. proposed stat Proposed statistic to study Section: i18n
Projects
None yet
Development

No branches or pull requests

4 participants