Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to specify the content files for Tailwind CSS tree-shaking.
Tailwind
module.exports = {
content: [[1]],
theme: {
extend: {},
},
plugins: [],
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Including files that don't contain Tailwind classes like images or compiled CSS.
Using wrong file extensions in the content array.
✗ Incorrect
The content array should include the source files where Tailwind classes are used, typically './src/**/*.{html,js}'.
2fill in blank
mediumComplete the code to add multiple content paths for Tailwind CSS tree-shaking.
Tailwind
module.exports = {
content: [[1], './components/**/*.{vue,js}'],
theme: {
extend: {},
},
plugins: [],
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding folders that don't contain Tailwind classes.
Using incorrect file extensions in the glob pattern.
✗ Incorrect
You can add multiple paths in the content array. './src/**/*.{html,js}' is a common source folder for HTML and JS files.
3fill in blank
hardFix the error in the content configuration to properly enable tree-shaking.
Tailwind
module.exports = {
content: [1],
theme: {
extend: {},
},
plugins: [],
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of an array causes Tailwind to not scan files correctly.
Using parentheses or curly braces instead of square brackets.
✗ Incorrect
The content property must be an array of strings, so it needs square brackets around the path strings.
4fill in blank
hardFill both blanks to configure Tailwind to scan HTML and Vue files for tree-shaking.
Tailwind
module.exports = {
content: [[1], [2]],
theme: {
extend: {},
},
plugins: [],
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Including folders with no Tailwind classes.
Using wrong file extensions in the glob patterns.
✗ Incorrect
To cover both HTML/JS and Vue files, include './src/**/*.{html,js}' and './components/**/*.{vue,js}' in the content array.
5fill in blank
hardFill all three blanks to configure Tailwind content for HTML, Vue, and React files.
Tailwind
module.exports = {
content: [[1], [2], [3]],
theme: {
extend: {},
},
plugins: [],
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Missing one or more file types in the content array.
Including folders without Tailwind classes.
✗ Incorrect
Include paths for HTML/JS, Vue, and React files to ensure Tailwind scans all relevant files for tree-shaking.