Publishing the preset as an npm package allows you to maintain one source of truth. Each project can install and update the preset easily. Copying files manually or using CDN links does not provide easy updates or version control.
@myorg/tailwind-preset, which tailwind.config.js snippet correctly extends it?module.exports = {
presets: [/* ??? */],
theme: {
extend: {
colors: {
primary: '#123456'
}
}
}
}The presets array expects the preset module to be imported using require(). Option D correctly wraps the preset in an array and uses require().
colors: { brand: '#ff0000' }. Your project extends it with colors: { brand: '#00ff00' }. What color will the class text-brand apply?Tailwind merges the theme.extend object with the preset. The project’s extension overrides the preset’s color for the same key. So text-brand uses green (#00ff00).
group-hover for a utility. Which snippet correctly adds this variant inside the preset's tailwind.config.js?module.exports = {
variants: {
extend: {
backgroundColor: [/* ??? */]
}
}
}Variants must be arrays. Adding 'group-hover' inside the array extends the backgroundColor utilities to respond to group hover state.
Using focus-visible variant allows showing focus outlines only when keyboard navigation is used, improving accessibility. Removing outlines globally or relying on JS is not recommended.