Loading...
Loading...
CSS naming conventions (BEM), nesting rules, and encapsulation guidelines for Shopify themes. Use when writing CSS for Shopify theme sections.
npx skill4agent add niccos-shopify-workspace/shopify-cursor-skills theme-shopify-css-guidelines.block {}
.block__element {}
.block__element--modifier {}.block__element--modifier/* Good - BEM structure */
.product-card {}
.product-card__image {}
.product-card__title {}
.product-card__price {}
.product-card__button {}
.product-card__button--primary {}
/* Bad - generic or visual naming */
.red-button {}
.big-text {}
.container {}.block { .block__element {} }/* Section-level namespacing */
.featured-collection {
padding: 2rem;
}
.featured-collection__grid {
display: grid;
gap: 1rem;
}
.featured-collection__item {
/* Block element */
}
.featured-collection__item:hover {
/* Pseudo-class */
}
.featured-collection__item--featured {
/* Modifier */
}/* Bad - too deep */
.section {
.block {
.element {
.sub-element {
/* 3+ levels - avoid */
}
}
}
}
/* Bad - cross-block dependency */
.section-a {
.section-b__element {
/* Don't style other sections' elements */
}
}/* featured-collection.css */
.featured-collection {
/* Section wrapper */
}
.featured-collection__header {
/* Section header */
}
.featured-collection__grid {
/* Main content area */
}
.featured-collection__item {
/* Grid item */
}
.featured-collection__item:hover {
/* Hover state */
}
@media (max-width: 749px) {
.featured-collection__grid {
/* Mobile styles */
}
}