Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add custom 26rem value in max-height on tailwindcss

Tags:

tailwind-css

I'm able to get up to 24rem on max-height using tailwindcss, but not 26rem. How would I add this value? I was not able to find information on how to do this in the docs: https://tailwindcss.com/docs/max-height . The only value-related changes I can find are for adding scale. Thank you!

like image 970
reactor Avatar asked Oct 20 '25 17:10

reactor


2 Answers

You could add it manually on tailwind.config.js and recompile it

 theme: {
    extend: {
      height: {
        100: '24rem',
      },
    },
 },

therefore, you can use class max-h-100 on your class list.

like image 59
Kevin Yobeth Avatar answered Oct 23 '25 17:10

Kevin Yobeth


You have two options:

  1. You can add the values directly inside your class names like so: follow the link

<div class="h-[250px] w-[30rem] absolute top-[1rem] ..."></div>

  1. the second approach is by using config file which locates in your project root directory: <<tailwind.config.js>>: follow the link
module.exports = {
          theme: {
            extend: {
              height: {
                '128': '32rem',
              }
            }
          }
        }
like image 23
VeRJiL Avatar answered Oct 23 '25 15:10

VeRJiL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!