search results:

    • Standard
    • React
    Pricing Learn Community
    • + D
    • Light
    • Dark
    • System
    logo TW Elements
    • Getting started
      • Quick start
      • Tutorials
      • Design system
      • Local installation
      • Optimization
      • Dark mode
      • Theming
      • Changelog
      • Migrating to v2
      • Internationalization guide
      • Class customization
      • Icons Integration
    • CommercialNew
      • Pricing
      • License
      • Installation
      • Git & repository
      • Premium Support
    • Integrations
      • Angular
      • ASP.NET
      • Django
      • Express
      • Laravel
      • Next
      • Nuxt
      • Qwik
      • React
      • Remix
      • Solid
      • Svelte
      • SvelteKit
      • Vue
    • Content & styles
      • Animations
      • Animations Extended
      • Colors
      • Dividers
      • Figures
      • Headings
      • Hover effects
      • Icons
      • Images
      • Mask
      • Shadows
      • Typography
    • Navigation
      • Breadcrumbs
      • Footer
      • Headers
      • Mega menu
      • Navbar
      • Offcanvas
      • Pagination
      • Pills
      • Scrollspy
      • Sidenav
      • Tabs
    • Components
      • Accordion
      • Alerts
      • Avatar
      • Badges
      • Button group
      • Buttons
      • Cards
      • Carousel
      • Chips
      • Collapse
      • Dropdown
      • Gallery
      • Jumbotron
      • Lightbox
      • Link
      • List group
      • Modal
      • Notifications
      • Paragraphs
      • Placeholders
      • Popconfirm
      • Popover
      • Progress
      • Rating
      • Scroll back to top button
      • Social buttons
      • Spinners
      • Stepper
      • Testimonials
      • Timeline
      • Toast
      • Tooltip
      • Video
      • Video carousel
    • Forms
      • Autocomplete
      • Checkbox
      • Datepicker
      • Datetimepicker
      • File input
      • Form templates
      • Input Group
      • Inputs
      • Login form
      • Multi range slider
      • Radio
      • Range
      • Registration form
      • Search
      • Select
      • Switch
      • Textarea
      • Timepicker
      • Validation
    • Data
      • Charts
      • Charts advanced
      • Datatables
      • Tables
    • Methods
      • Clipboard
      • Infinite scroll
      • Lazy loading
      • Loading management
      • Ripple
      • Scrollbar
      • Smooth scroll
      • Sticky
      • Touch
    • Design Blocks
      • Admin Charts
      • Admin Complex
      • Admin Forms
      • Admin Maps
      • Admin Navigation
      • Admin tables
      • Banners
      • Contact
      • Content
      • CTA
      • FAQ
      • Features
      • Headers
      • Hero / Intro sections
      • Logo clouds
      • Mega menu
      • News
      • Newsletter
      • Pricing
      • Projects
      • Stats
      • Stats admin
      • Team
      • Testimonials
    • Tools
      • Button generator
      • Card generator
      • Flexbox generator
      • Footer generator
      • Form builder
      • Grid generator
      • Icon generator
      • Instagram Filters generator
      • Logo generator
      • Table generator
      • Typography generator
    • Coming Soon
      • Angular
      • Builder
      • Templates
      • Vue
    • Resources
      • Playground
      • YouTube Channel
      • Private FB Group
      • Newsletter
      • UI Design course New
      • UI / UX tips
    • Overview
    • Theming

    Theme

    Tailwind CSS Theme

    Customize Tailwind default theme or create a new theme for your projects


    Configuration

    The theme section of your tailwind.config.js file is where you define your project’s color palette, type scale, fonts, breakpoints, border radius values, and more.

    • tailwind.config.js
            
                
                module.exports = {
                  theme: {
                    screens: {
                      sm: '480px',
                      md: '768px',
                      lg: '976px',
                      xl: '1440px',
                    },
                    colors: {
                      'blue': '#1fb6ff',
                      'purple': '#7e5bef',
                      'pink': '#ff49db',
                      'orange': '#ff7849',
                      'green': '#13ce66',
                      'yellow': '#ffc82c',
                      'gray-dark': '#273444',
                      'gray': '#8492a6',
                      'gray-light': '#d3dce6',
                    },
                    fontFamily: {
                      sans: ['Graphik', 'sans-serif'],
                      serif: ['Merriweather', 'serif'],
                    },
                    extend: {
                      spacing: {
                        '128': '32rem',
                        '144': '36rem',
                      },
                      borderRadius: {
                        '4xl': '2rem',
                      }
                    }
                  }
                }
              
            
        

    Theming

    You can customize theme in Tailwind in a two similiar ways: by extending default values or editing them.

    Extending the default theme

    Extending the default theme preserves values already made by Tailwind. Just add your extensions under the extend key in the theme section of your configuration file. This particular case below is showing how to add an extra breakpoint but save the existing ones at the same time.

    • tailwind.config.js
            
                
              module.exports = {
                theme: {
                  extend: {
                    // Adds a new breakpoint in addition to the default breakpoints
                    screens: {
                      '3xl': '1600px',
                    }
                  }
                }
              }
            
            
        

    Overriding the default theme

    Overriding the default theme completely replace options already made by Tailwind. Just add your overrides directly under the theme section of your configuration file. This particular case below is showing how completely replace Tailwind’s default configuration for that key, so in the example below none of the default opacity utilities would be generated.

    • tailwind.config.js
            
                
              module.exports = {
                theme: {
                  // Replaces all of the default `opacity` values
                  opacity: {
                    '0': '0',
                    '20': '0.2',
                    '40': '0.4',
                    '60': '0.6',
                    '80': '0.8',
                    '100': '1',
                  }
                }
              }
            
            
        

    You can of course both override some parts of the default theme and extend other parts of the default theme within the same configuration.

    • tailwind.config.js
            
                
              module.exports = {
                theme: {
                  opacity: {
                    '0': '0',
                    '20': '0.2',
                    '40': '0.4',
                    '60': '0.6',
                    '80': '0.8',
                    '100': '1',
                  },
                  extend: {
                    screens: {
                      '3xl': '1600px',
                    }
                  }
                }
              }
            
            
        

    Related resources

    Theming Colors Shadows Dark theme

    If you are looking for more advanced options, try theme from MDBootstrap.

    • Configuration
    • Theming
    • Related resources
    Get useful tips & free resources directly to your inbox along with exclusive subscriber-only content.
    Join our mailing list now
    © 2024 Copyright: MDBootstrap.com

    Access restricted

    To view this section you must have an active PRO account

    Log in to your account or purchase an TWE subscription if you don't have one.

    Buy TWE PRO