0
0
Tailwindmarkup~10 mins

Purging unused styles in Tailwind - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable purging unused styles in Tailwind CSS configuration.

Tailwind
module.exports = {
  content: [[1]],
  theme: {
    extend: {},
  },
  plugins: [],
}
Drag options to blanks, or click blank then click option'
A"./src/**/*.{html,js}"
B"./node_modules/**/*"
C"./public/index.html"
D"./styles/**/*.css"
Attempts:
3 left
💡 Hint
Common Mistakes
Using paths that don't include your source files.
Including node_modules folder which is unnecessary.
2fill in blank
medium

Complete the code to add a safelist to prevent purging of specific classes.

Tailwind
module.exports = {
  content: ["./src/**/*.{html,js}"],
  safelist: [[1]],
  theme: {
    extend: {},
  },
  plugins: [],
}
Drag options to blanks, or click blank then click option'
A"bg-red-500 text-center"
B"bg-red-500", "text-center"
C["bg-red-500", "text-center"]
D"bg-red-500"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string with multiple classes instead of separate strings.
Using nested arrays or incorrect syntax.
3fill in blank
hard

Fix the error in the purge configuration to correctly specify the content paths.

Tailwind
module.exports = {
  purge: [[1]],
  theme: {
    extend: {},
  },
  plugins: [],
}
Drag options to blanks, or click blank then click option'
A"./src/**/*.{css,js}"
B"./src/**/*.{html,js}"
C"./src/**/*.{html,js,jsx}"
D"./src/**/*.{html,css}"
Attempts:
3 left
💡 Hint
Common Mistakes
Using outdated purge key without proper file extensions.
Missing important file types like jsx.
4fill in blank
hard

Fill both blanks to configure Tailwind to purge unused styles from HTML and Vue files.

Tailwind
module.exports = {
  content: [[1], [2]],
  theme: {
    extend: {},
  },
  plugins: [],
}
Drag options to blanks, or click blank then click option'
A"./src/**/*.html"
B"./src/**/*.vue"
C"./public/**/*.js"
D"./src/**/*.css"
Attempts:
3 left
💡 Hint
Common Mistakes
Including CSS files which don't contain Tailwind classes.
Missing Vue files in a Vue project.
5fill in blank
hard

Fill all three blanks to configure Tailwind with content paths, safelist, and enable JIT mode.

Tailwind
module.exports = {
  mode: [1],
  content: [[2]],
  safelist: [[3]],
  theme: {
    extend: {},
  },
  plugins: [],
}
Drag options to blanks, or click blank then click option'
A"jit"
B"./src/**/*.{html,js}"
C"text-lg"
D"aos-animate"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect mode value.
Putting multiple classes in one safelist string.
Missing important content paths.