Open rachelandrew opened 3 years ago
How would the algorithm for measuring that look like @rachelandrew? What kinds of properties and values would we be looking for?
square brackets in the track listing, so anything like:
grid-template-columns: [foo-start] 1fr [foo-end];
If the track listing has square brackets in it they are using named lines.
Ok, then the algorithm seems simple.
grid-template-columns
, grid-template-rows
, grid-template
, or grid
/\[([\w-]+)\]/
so we can find most popular names overallDoes that sound good, Rachel?
that should work I think.
JS:
This will count usage for named grid lines (returns an object literal with property names as keys and usage count as values):
countProperties(ast.stylesheet.rules, {properties: /^grid($|\-)/, values: /\[([\w-]+)\]/})
and this without, in case we want to compare:
countProperties(ast.stylesheet.rules, {properties: /^grid($|\-)/, values: /\[([\w-]+)\]/})
Are people naming lines? Anecdotally I didn't see a lot of use of this until the last year, I'm getting more questions about it recently and it feels as if it was something people found an extra complexity but now they are using grid more they find it is useful. I'd be interested to know if the stats bear that out.