Conversation
This adds our internal Liquid cursor rule that enables Cursor to better understand Liquid development to the skeleton-theme for all theme developers to enjoy. (and ideally contribute to so we can make it even better!)
tyleralsbury
left a comment
There was a problem hiding this comment.
A few potential tweaks, but approving.
| <bem> | ||
| - Use BEM naming convention: | ||
| - Block: the component | ||
| - Element: child of component (block__element) | ||
| - Modifier: variant (block--modifier, block__element--modifier) | ||
| - Use dashes to separate words in blocks/elements/modifiers | ||
| </bem> |
There was a problem hiding this comment.
I wonder if this is too specific - some developers may not want to use bem.
| </media-queries> | ||
|
|
||
| <nesting> | ||
| - Do not use & operator |
There was a problem hiding this comment.
This ended up a bit outdated - we do use that operator in Horizon, in the end.
|
|
||
| <nesting> | ||
| - Do not use & operator | ||
| - Never nest beyond first level |
There was a problem hiding this comment.
We also break this rule. The whole bit here about nesting could probably use a rewrite.
It's more that we try to avoid doing nesting where & bounces around too much, for example:
.foo {
& .bar {
.baz & { // <-- the selector here is hard to understand at a glance. It becomes worse when you've got things like `:not` or `is` in the mix.
}
}
}Co-authored-by: Tyler Alsbury <60230011+tyleralsbury@users.noreply.github.com>
|
I feel like we should add this to the CLI/theme-liquid-docs so that folks can add it to any theme. We could also include logic in the CLI/theme-liquid-docs to make this file updatable. Otherwise this file will grow stale and we'll depend on a human to update it. |
| { name: "item_count_for_variant", usage: "cart | item_count_for_variant: {variant_id}" }, | ||
| { name: "line_items_for", usage: "cart | line_items_for: object" }, | ||
|
|
||
| // html | ||
| { name: "class_list", usage: "settings.layout | class_list" }, | ||
| { name: "time_tag", usage: "string | time_tag: string" }, | ||
| { name: "inline_asset_content", usage: "asset_name | inline_asset_content" }, | ||
| { name: "highlight", usage: "string | highlight: string" }, | ||
| { name: "link_to", usage: "string | link_to: string" }, | ||
| { name: "placeholder_svg_tag", usage: "string | placeholder_svg_tag" }, | ||
| { name: "preload_tag", usage: "string | preload_tag: as: string" }, | ||
| { name: "script_tag", usage: "string | script_tag" }, | ||
| { name: "stylesheet_tag", usage: "string | stylesheet_tag" }, |
There was a problem hiding this comment.
I feel like that is something that we should not have to maintain given that https://github.com/Shopify/theme-liquid-docs/blob/main/data/filters.json exists.
This <liquid_rules> thing should be a derived value of the filters.json file that we get updated automatically from core.
There was a problem hiding this comment.
Agreed. Love this. Let's do it that way instead!
|
@mxstbr Wondering if you have a completed version you can share? |

This adds our internal Liquid cursor rule that enables Cursor to better understand Liquid development to the skeleton-theme for all theme developers to enjoy. (and ideally contribute to so we can make it even better!)