Skills for building AEM Edge Delivery Services sites — block development, content modeling, code review, testing, and page import.
82
76%
Does it follow best practices?
Impact
88%
1.04xAverage score across 6 eval scenarios
Advisory
Suggest reviewing before use
All CSS selectors must be scoped to the block. This is critical to prevent style leakage between blocks.
✅ Good - scoped to block:
main .my-block {
padding: 1rem;
}
main .my-block h2 {
font-size: var(--heading-font-size-m);
}❌ Bad - not scoped:
/* This will affect ALL h2 elements on the page */
h2 {
font-size: var(--heading-font-size-m);
}
/* This will affect elements outside the block */
.item {
padding: 1rem;
}Scoping pattern:
main .{block-name}⚠️ Special note on -wrapper and -container classes:
The platform automatically adds .{block-name}-wrapper and .{block-name}-container divs outside your block. If you need to style elements with these class names inside your block, you must scope them carefully:
/* ❌ Bad - will affect the wrapper OUTSIDE your block */
main .my-block-wrapper {
padding: 2rem;
}
/* ✅ Good - only affects wrappers INSIDE your block */
main .my-block .my-block-wrapper {
padding: 2rem;
}
/* Better - avoid using these class names inside your block */
main .my-block .inner-wrapper {
padding: 2rem;
}Best practice: Avoid using -wrapper or -container suffix for classes inside your block to prevent confusion.
Use BEM-like naming for elements within your block:
/* Block */
main .my-block {
/* block styles */
}
/* Element - using descriptive class names */
main .my-block .item {
/* item styles */
}
main .my-block .item-title {
/* item title styles */
}
/* Modifier/variant */
main .my-block.dark {
/* dark variant styles */
}
main .my-block.wide .item {
/* item styles in wide variant */
}Key points:
.container, .wrapper - be specific to your blockLeverage CSS custom properties defined in styles/styles.css for consistency:
Colors:
main .my-block {
background-color: var(--background-color);
color: var(--text-color);
}
main .my-block a:any-link {
color: var(--link-color);
}
main .my-block a:hover {
color: var(--link-hover-color);
}Typography:
main .my-block h2 {
font-family: var(--heading-font-family);
font-size: var(--heading-font-size-m);
}
main .my-block p {
font-family: var(--body-font-family);
font-size: var(--body-font-size-m);
}Layout:
main .my-block {
max-width: var(--max-content-width);
padding-inline: var(--inline-section-padding);
}Available custom properties:
--clr-*, --link-color, --background-color, --text-color, etc.--body-font-family, --heading-font-family, --fixed-font-family--heading-font-size-*, --body-font-size-*--max-content-width, --inline-section-paddingSee styles/styles.css for the complete list.
Write styles mobile-first, then add media queries for larger screens:
/* Mobile styles (default) */
main .my-block {
padding: 1rem;
flex-direction: column;
}
/* Tablet and up */
@media (width >= 600px) {
main .my-block {
padding: 2rem;
}
}
/* Desktop and up */
@media (width >= 900px) {
main .my-block {
flex-direction: row;
padding: 4rem;
}
}Standard breakpoints:
@media (width >= 600px)@media (width >= 900px)Modern syntax:
(width >= 600px) instead of (min-width: 600px)Use modern CSS features for better maintainability and performance:
Logical properties:
/* Use logical properties for internationalization */
main .my-block {
padding-inline: 1rem; /* left/right in LTR, right/left in RTL */
padding-block: 2rem; /* top/bottom */
margin-inline-start: 1rem; /* left in LTR */
border-inline-start: 2px solid black;
}Modern layout:
/* Flexbox */
main .my-block {
display: flex;
gap: 1rem; /* Better than margin hacks */
flex-wrap: wrap;
}
/* Grid */
main .my-block {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}Modern color syntax:
main .my-block {
background-color: rgb(0 0 0 / 20%); /* Modern RGB with alpha */
color: hsl(200 50% 50%); /* HSL syntax */
}Avoid overly specific selectors:
✅ Good - low specificity:
main .my-block .item {
padding: 1rem;
}
main .my-block .item-title {
font-size: 1.5rem;
}❌ Bad - high specificity:
main .my-block div div div.item {
padding: 1rem;
}
main div.my-block > div > h2.item-title {
font-size: 1.5rem;
}Best practices:
Use the variant class alongside the block class:
/* Base block */
main .my-block {
background-color: var(--background-color);
color: var(--text-color);
}
/* Dark variant */
main .my-block.dark {
background-color: var(--dark-color);
color: var(--clr-white);
}
/* Wide variant */
main .my-block.wide {
max-width: 100%;
}
/* Combining variants */
main .my-block.dark.wide {
/* Styles for both dark and wide */
}Minimize reflows and repaints:
/* Prefer transforms over position changes */
main .my-block .item {
transform: translateX(10px); /* Better performance */
}
/* Avoid this: */
main .my-block .item {
left: 10px; /* Triggers reflow */
}Use will-change sparingly:
/* Only for elements that will definitely animate */
main .my-block .animated-item {
will-change: transform;
}Avoid expensive properties on large elements:
/* Be careful with these on large areas: */
/* box-shadow, border-radius, opacity, filters */Formatting:
Example:
main .my-block,
main .my-block .item {
display: flex;
padding: 1rem;
gap: 1rem;
}Order of properties (recommended):
main .my-block ul {
list-style: none;
margin: 0;
padding: 0;
}main .my-block {
max-width: var(--max-content-width);
margin-inline: auto;
}main .my-block .video-container {
aspect-ratio: 16 / 9;
}main .my-block .truncated {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}❌ Don't use !important:
/* Avoid this */
main .my-block {
color: red !important;
}
/* Fix specificity issues properly instead */❌ Don't style elements outside your block:
/* Bad - modifies header globally */
main .my-block {
/* ... */
}
header {
background: red;
}❌ Don't hardcode values when variables exist:
/* Bad */
main .my-block {
font-family: 'Lato', sans-serif;
color: #666;
}
/* Good */
main .my-block {
font-family: var(--body-font-family);
color: var(--text-color);
}❌ Don't use absolute positioning for layout:
/* Prefer flexbox or grid for layout */
/* Use absolute positioning only for visual effects */evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
skills
analyze-and-plan
block-collection-and-party
block-inventory
building-blocks
code-review
content-driven-development
content-modeling
docs-search
find-test-content
generate-import-html
identify-page-structure
page-decomposition
page-import
preview-import
scrape-webpage
testing-blocks