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

Logical vs physical properties #43

Open
LeaVerou opened this issue Jul 24, 2020 · 2 comments
Open

Logical vs physical properties #43

LeaVerou opened this issue Jul 24, 2020 · 2 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

@LeaVerou
Copy link
Owner

Last year, we only measured the percentage of pages that use any logical property.

While this is a useful measurement, I would like to measure:

  • Which logical properties are used most?
  • How does the usage compare with their physical counterparts for each?
@LeaVerou LeaVerou added proposed stat Proposed statistic to study Section: i18n labels Jul 24, 2020
@LeaVerou LeaVerou added ⚠️ Needs algorithm ⚠️ Needs JS Needs JS to calculate this stat ⚠️ Needs SQL Needs SQL to calculate this stat labels Aug 4, 2020
@LeaVerou
Copy link
Owner Author

Alright, so this seems tedious, but straightforward. It appears to be a single task of counting properties and comparing the counts, making sure not to forget about the various shorthands.

List of logical properties: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties

@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 LeaVerou added this to Has algorithm in Almanac 2020 Aug 22, 2020
LeaVerou added a commit that referenced this issue Sep 18, 2020
@LeaVerou
Copy link
Owner Author

LeaVerou commented Sep 18, 2020

Just pushed JS for this. It measures use of all logical properties or properties with logical keywords (except those with the logical keyword, since AFAIK that's not supported anywhere). Since there's no "physical counterpart" (e.g. you can't say inline-size is basically width, since that's only true for Western languages), they are categorized in buckets based on what they do, regardless of direction.

Sample output for the Chrome UA stylesheet:

{
	"logical": {
		"total": 86,
		"margin": 72,
		"padding": 10,
		"text-align": 3,
		"min-size": 1
	},
	"physical": {
		"total": 49,
		"size": 30,
		"inset": 6,
		"text-align": 5,
		"min-size": 4,
		"overflow": 2,
		"margin": 1,
		"resize": 1
	}
}

@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 18, 2020
@LeaVerou LeaVerou moved this from Has algorithm to Has JS in Almanac 2020 Sep 18, 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
@rviscomi rviscomi moved this from Has JS to Has SQL in Almanac 2020 Oct 24, 2020
Repository owner deleted a comment from caraya Dec 7, 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
Development

No branches or pull requests

2 participants