@material-tailwind/react makes it easy to customize the theme of your application. You can customize the theme by using the mtConfig on your tailwind.config.js file.
Below check the default theme used for Material Tailwind and learn how to custom the theme.
#Default Theme
const mtConfig = {
radius: "1.5rem",
fonts: {
sans: "Inter",
mono: "Fira Code"
},
colors: {
background: "#FFFFFF",
foreground: "#4B5563",
surface: {
default: "#E5E7EB",
dark: "#030712",
light: "#F9FaFB",
foreground: "#1F2937"
},
primary: {
default: "#111827",
dark: "#030712",
light: "#1F2937",
foreground: "#F9FAFB"
},
secondary: {
default: "#E5E7EB",
dark: "#D1D5DB",
light: "#F9FAFB",
foreground: "#030712"
},
info: {
default: "#2563EB",
dark: "#1D4ED8",
light: "#3B82F6",
foreground: "#F9FAFB"
},
success: {
default: "#16A34A",
dark: "#15803D",
light: "#22C55E",
foreground: "#F9FAFB"
},
warning: {
default: "#EAB308",
dark: "#CA8A04",
light: "#FACC15",
foreground: "#030712"
},
error: {
default: "#DC2626",
dark: "#B91C1C",
light: "#EF4444",
foreground: "#F9FAFB"
},
},
darkColors: {
background: "#030712",
foreground: "#9CA3AF",
surface: {
default: "#1F2937",
dark: "#F9FAFB",
light: "#111827",
foreground: "#E5E7EB"
},
primary: {
default: "#F3F4F6",
dark: "#E5E7EB",
light: "#F9FAFB",
foreground: "#030712"
},
secondary: {
default: "#1F2937",
dark: "#111827",
light: "#374151",
foreground: "#F9FAFB"
},
info: {
default: "#3B82F6",
dark: "#60A5FA",
light: "#2563EB",
foreground: "#030712"
},
success: {
default: "#22C55E",
dark: "#16A34A",
light: "#4ADE80",
foreground: "#030712"
},
warning: {
default: "#FACC15",
dark: "#EABC08",
light: "#FDE047",
foreground: "#030712"
},
error: {
default: "#EF4444",
dark: "#DC2626",
light: "#F87171",
foreground: "#030712"
},
}
}
const mtConfig = {
radius: "1.5rem",
fonts: {
sans: "Inter",
mono: "Fira Code"
},
colors: {
background: "#FFFFFF",
foreground: "#4B5563",
surface: {
default: "#E5E7EB",
dark: "#030712",
light: "#F9FaFB",
foreground: "#1F2937"
},
primary: {
default: "#111827",
dark: "#030712",
light: "#1F2937",
foreground: "#F9FAFB"
},
secondary: {
default: "#E5E7EB",
dark: "#D1D5DB",
light: "#F9FAFB",
foreground: "#030712"
},
info: {
default: "#2563EB",
dark: "#1D4ED8",
light: "#3B82F6",
foreground: "#F9FAFB"
},
success: {
default: "#16A34A",
dark: "#15803D",
light: "#22C55E",
foreground: "#F9FAFB"
},
warning: {
default: "#EAB308",
dark: "#CA8A04",
light: "#FACC15",
foreground: "#030712"
},
error: {
default: "#DC2626",
dark: "#B91C1C",
light: "#EF4444",
foreground: "#F9FAFB"
},
},
darkColors: {
background: "#030712",
foreground: "#9CA3AF",
surface: {
default: "#1F2937",
dark: "#F9FAFB",
light: "#111827",
foreground: "#E5E7EB"
},
primary: {
default: "#F3F4F6",
dark: "#E5E7EB",
light: "#F9FAFB",
foreground: "#030712"
},
secondary: {
default: "#1F2937",
dark: "#111827",
light: "#374151",
foreground: "#F9FAFB"
},
info: {
default: "#3B82F6",
dark: "#60A5FA",
light: "#2563EB",
foreground: "#030712"
},
success: {
default: "#22C55E",
dark: "#16A34A",
light: "#4ADE80",
foreground: "#030712"
},
warning: {
default: "#FACC15",
dark: "#EABC08",
light: "#FDE047",
foreground: "#030712"
},
error: {
default: "#EF4444",
dark: "#DC2626",
light: "#F87171",
foreground: "#030712"
},
}
}
#Radius
The radius property is used to set the base border-radius for your design system, based on that value all of the values for rounded-sm, rounded, rounded-md, rounded-lg, rounded-xl, rounded-2xl and rounded-3xl are calculated, this way you only need to change one value to change all of the border-radius values and this will apply to all of the components.
#Fonts
The fonts property is used to set the default fonts for your design system, you can set the sans for sans-serif fonts and mono for monospace fonts and this will apply to all of the components.
The colors property is used to set the default colors for your design system, these colors are used for all of the components, each color has 4 different shades default, dark, light and foreground used for different purposes.
The darkColors property is used to set the default dark mode colors for your design system, these colors are used for all of the components, each color has 4 different shades default, dark, light and foreground used for different purposes.