How to disable or enable button with Alpine js - html

I have this increment and decrement dropdown on my page. I want to add a max-min value to it, and when the max or min value is reached, I what my button to be disabled.
I am new to Alpine.
If you have any suggestions for my code, I will be pleased and open to them, and I would appreciate it. 
<!-- Occupancy -->
<div class="relative md:w-auto w-full">
<div class="flex justify-center">
<div
x-data="{
open: false,
total: 0,
incrementTotal() {
this.total++;
},
decrementTotal() {
this.total--;
},
toggle() {
if (this.open) {
return this.close()
}
this.$refs.button.focus()
this.open = true
},
close(focusAfter) {
if (! this.open) return
this.open = false
focusAfter && focusAfter.focus()
}
}"
x-on:keydown.escape.prevent.stop="close($refs.button)"
x-on:focusin.window="! $refs.panel.contains($event.target) && close()"
x-id="['dropdown-button']"
class="relative w-full"
>
<!-- Button -->
<button
x-ref="button"
x-on:click="toggle()"
:aria-expanded="open"
:aria-controls="$id('dropdown-button')"
type="button"
class="flex items-center gap-2 bg-white px-15 md:py-20 py-18 md:w-[90px] w-full rounded-md shadow flex-row"
>
<div class="flex flex-row space-x-16">
<x-icons.user-account class="w-24 h-24 text-black cursor-pointer" />
<div class="text-base text-left">
<span x-text="total" class="w-[30px] text-center" :value="total"></span>
</div>
</div>
</button>
<!-- Panel -->
<div
x-ref="panel"
x-show="open"
x-transition.origin.top.left
x-on:click.outside="close($refs.button)"
:id="$id('dropdown-button')"
style="display: none;"
class="absolute right-0 md:top-full top-[90%] mt-16 p-24 z-50 md:w-[300px] w-full rounded-md bg-white shadow-2xl space-y-24"
>
<div class="font-bold text-2xl text-black text-left">
<p>Heading here</p>
</div>
<div class="flex flex-row justify-between items-center w-full" x-data="{ number: 0 }">
<div class="flex flex-col text-base text-black w-full">
<p>Something</p>
<div class="text-gray-700">
<p>Something else</p>
</div>
</div>
<div class="flex space-x-8 items-center md:justify-center justify-end w-full text-base" x-data="{ count: 1, buttonDisabled: false }" x-modelable="count" x-model="number">
<button class="rounded-full border-1 border-gray-700 p-10" #click="count--; decrementTotal(); if(total < 1){total = 1; buttonDisabled = true} else{buttonDisabled = false}" x-bind:disabled="buttonDisabled"><x-icons.minus class="w-16 h-16"/></button>
<span x-text="number" class="w-[30px] text-center" required min="1" max="6" :value="total"></span>
<button class="rounded-full border-1 border-gray-700 p-10" #click="count++; incrementTotal(); if(total > 6){total = 6; buttonDisabled = true} else{buttonDisabled = false}" x-bind:disabled="buttonDisabled"><x-icons.plus-add class="w-16 h-16"/></button>
</div>
</div>
<div class="flex flex-row justify-between items-center w-full" x-data="{ number: 0 }">
<div class="flex flex-col text-base text-black w-full">
<p>Something 2</p>
<div class="text-gray-700">
<p>Something else 2</p>
</div>
</div>
<div class="flex space-x-8 items-center md:justify-center justify-end w-full text-base" x-data="{ count: 1, buttonDisabled: false }" x-modelable="count" x-model="number">
<button class="rounded-full border-1 border-gray-700 p-10" #click="count--; decrementTotal(); if(total < 1){total = 1; buttonDisabled = true} else{buttonDisabled = false}" x-bind:disabled="buttonDisabled"><x-icons.minus class="w-16 h-16"/></button>
<span x-text="number" class="w-[30px] text-center" required min="1" max="6" :value="total"></span>
<button class="rounded-full border-1 border-gray-700 p-10" #click="count++; incrementTotal(); if(total > 6){total = 6; buttonDisabled = true} else{buttonDisabled = false}" x-bind:disabled="buttonDisabled"><x-icons.plus-add class="w-16 h-16"/></button>
</div>
</div>
</div>
</div>
</div>
</div>
In my code after one click the button is disabled.

Related

Hide Spinner element when loading api done typescript

How to hide the spinner when the API load? how to use the *ngIf for this type of problem?
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js"></script>
<div class="flex flex-col items-center mt-2">
<div >
<mat-progress-spinner mode="indeterminate">
<div class="text-7xl sm:text-8xl font-bold tracking-tight leading-none text-amber-500" >
{{weather.current.humidity}}
</div>
</mat-progress-spinner>
</div>
<div class="flex items-baseline justify-center w-full mt-5 text-secondary"></div>
</div>

Tailwind Wrong Image Width

There is a problem while styling tailwind-react app.
The image must be look like this:
But my image looking like this. As you can see, it is not 438px.
Source code:
<div className='flex flex-col fg:flex-row w-full fg:h-[340px] fg:items-center hover:bg-gray-100 transition-colors duration-250'>
<div className='flex h-60 fg:h-[292px] fg:w-[438px] border border-black'>
<img className='w-full h-full object-cover object-center' src={require('../../image.jpg')} />
</div>
<div className='flex flex-col pl-4 pr-6 pt-6 pb-6'>
<h1 className='text-[28px] font-bold'>{item.title}</h1>
<p className='text-[17px] mt-1'>{item.summary}</p>
<div className='flex flex-col mt-2 sm:flex-row sm:gap-[10px]'>
<p className='text-gray-500 block text-[14px]'><Link to="/about" className='hover:underline'>{item.author}</Link></p>
<div className='flex gap-[10px] mt-1 sm:mt-0'>
<div className='flex'>
<Link to="/"><span className='flex flex-row'><FavoriteBorderSVG className='w-[16px] fill-gray-500' /><p className='text-sm text-gray-500 mt-[1px] ml-[2px]'>{` ${item.likeCount && item.likeCount != "0" ? item.likeCount : ""}`}</p></span></Link>
</div>
<div className='flex'>
<Link to="/"><span className='flex flex-row'><ChatBubbleBorderSVG className='w-[16px] fill-gray-500' /><p className='text-sm text-gray-500 mt-[1px] ml-[2px]'>{` ${item.commentCount && item.commentCount != "0" ? item.commentCount : ""}`}</p></span></Link>
</div>
<div className='flex'>
<Link to="/"><span className='flex flex-row'><ShareSVG className='w-[16px] fill-gray-500'/></span></Link>
</div>
</div>
</div>
</div>
</div>

Force div to bottom of flex container

Using tailwind, I am trying to get the "footer" to the bottom of the page. Nothing I do seems to get it where it needs to be. I am wondering if fresh eyes can help me here.
<template>
<Head title="Log in" />
<div class="min-h-screen flex bg-gray-900">
<div class="w-1/2 flex-1 flex flex-col justify-center">
<div class="mx-auto w-full max-w-sm lg:w-96">
<div>
<div class="tracking-wider uppercase flex justify-center text-4xl md:mt-0 md:order-1 font-logo">
<div class="text-white">REALKINK</div><div class="text-red-600">MEN</div>
</div>
<div class="mt-6 relative">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t border-gray-700" />
</div>
<div class="relative flex justify-center text-sm">
</div>
</div>
<h2 class="flex justify-center mt-6 text-xl font-extrabold text-gray-300">Sign in to your account</h2>
</div>
<div class="mt-8">
<div class="mt-6">
<form action="#" method="POST" class="space-y-6">
<div>
<label for="email" class="block text-sm font-medium text-gray-300"> Email address </label>
<div class="mt-1">
<input id="email" name="email" type="email" autocomplete="email" required="" class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm" />
</div>
</div>
<div class="space-y-1">
<label for="password" class="block text-sm font-medium text-gray-300"> Password </label>
<div class="mt-1">
<input id="password" name="password" type="password" autocomplete="current-password" required="" class="appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm placeholder-gray-400 focus:outline-none focus:ring-red-500 focus:border-red-500 sm:text-sm" />
</div>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center">
<input id="remember-me" name="remember-me" type="checkbox" class="h-4 w-4 text-red-600 focus:ring-red-500 border-gray-300 rounded" />
<label for="remember-me" class="ml-2 block text-sm text-gray-300"> Remember me </label>
</div>
<div class="text-sm">
Forgot your password?
</div>
</div>
<div>
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500">Sign in</button>
</div>
</form>
</div>
</div>
</div>
<div class="sticky bottom-0 font-logo md:h-10 bg-gray-100 dark:bg-gray-900">
<div class="max-w-7xl mx-auto py-2 px-4 sm:px-6 md:flex md:items-center md:justify-between lg:px-8">
<div class="text-sm flex justify-center space-x-6 md:order-2">
<a href="/terms-of-service" class="text-gray-500 hover:text-red-700">
<span class="sr-only">Terms</span>
Terms
</a>
<a href="/privacy-policy" class="text-gray-500 hover:text-red-700">
<span class="sr-only">Privacy</span>
Privacy
</a>
<a href="#" class="text-gray-500 hover:text-red-700">
<span class="sr-only">Support</span>
Support
</a>
</div>
<div class="mt-2 md:mt-0 md:order-1">
<p class="text-center text-xs text-gray-500">© 2022 Real Kink LLC. All rights reserved.</p>
</div>
</div>
</div>
</div>
<div class="hidden lg:block relative w-0 flex-1">
<img class="absolute inset-0 h-full w-full object-cover" src="https://64.media.tumblr.com/7395cca2c3ec57278b71a63e3221d36a/482bae774b0fde2f-91/s2048x3072/a10ae44d666d4f8a0adec40b9f0030748c6f8745.jpg" alt="" />
</div>
</div>
</template>
<script>
import { defineComponent } from 'vue'
import { Head, Link } from '#inertiajs/inertia-vue3';
export default defineComponent({
components: {
Head,
Link,
},
props: {
canResetPassword: Boolean,
status: String
},
data() {
return {
form: this.$inertia.form({
email: '',
password: '',
remember: false
})
}
},
methods: {
submit() {
this.form
.transform(data => ({
... data,
remember: this.form.remember ? 'on' : ''
}))
.post(this.route('login'), {
onFinish: () => this.form.reset('password'),
})
}
}
})
</script>
I have put ALL the code here just to keep it clear and simple without any variables of issues. Again, I am just trying to get the footer to the bottom of the left column. Any help would be very appreciated!

Laravel 7 footer not displaying in certain webpages

I created a footer that I wanted to #include to other webpages. As such, I created #section('content'), then at the bottom #include('footer') then #endsection. Now this works only on my contact page which is showing the footer. But is not working on my home or blog pages. Below I will include the code I'm working on Laravel 7, using blade, tailwindcss, html/css. I tried multiple things like moving around #include, or #extends or #yeild but couldn't figure this out. Any help or direction would be appreciated.
When I inspect the homepage, for instance, the footer is being passed through but is mixed in with the navbar. When I inspect the contact page its placed where it should be at the bottom of the page. This has me stumped.
FOOTER
#extends('layout')
<footer>
<div class="flex justify-center bottom-0 bg-gray-800 h-18 pt-4 pb-4 static w-full">
<a href="https://paolotrulli.com" class="text-white hover:text-blue-800 m-2"><img class="h-10 w-10"
src="/images/global.svg"></a>
<a href="https://twitter.com/p_trulli" class="text-white hover:text-lue-800 m-2"><img class="h-10 w-10"
src="/images/twitter-black.svg"></a>
<a href="https://github.com/PT-83" class="text-white hover:text-blue-800 m-2"><img class="h-10 w-10"
src="/images/github.svg"></a>
<p class="text-white pt-4">Copyright 2020, Paolo Trulli</p>
</div>
</footer>
#yield('footer')
LAYOUT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine#v2.0.1/dist/alpine.js" defer></script>
<title>#yield('title')</title>
</head>
<html>
<body>
<div class="absolute inset-x-0 top-0">
<nav x-data="{ open: false }" #keydown.window.escape="open = false" class="bg-gray-800">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center h-24">
<div class="flex items-center">
<div class="flex-shrink-0">
<img class="h-12 w-12" src="/images/startup.svg" alt="icon" />
</div>
<div class="hidden md:block">
<div class="ml-10 flex items-baseline">
<a href="/home"
class="px-4 py-2 rounded-md text-lg font-medium text-white bg-gray-900 focus:outline-none focus:text-white focus:bg-gray-700">Home</a>
<a href="/contact"
class="ml-4 px-3 py-2 rounded-md text-lg font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Contact</a>
<a href="/blog"
class="ml-4 px-3 py-2 rounded-md text-lg font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Blog</a>
<a href="po"
class="ml-4 px-3 py-2 rounded-md text-lg font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"></a>
<a href="#"
class="ml-4 px-3 py-2 rounded-md text-lg font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"></a>
</div>
</div>
</div>
<div class="-mr-2 flex md:hidden">
<button #click="open = !open"
class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 focus:outline-none focus:bg-gray-700 focus:text-white">
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
<path :class="{'hidden': open, 'inline-flex': !open }" class="inline-flex" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
<path :class="{'hidden': !open, 'inline-flex': open }" class="hidden" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
</div>
</div>
</div>
<div :class="{'block': open, 'hidden': !open}" class="hidden md:hidden">
<div class="px-2 pt-2 pb-3 sm:px-3">
<a href="/home"
class="block px-3 py-2 rounded-md text-base font-medium text-white bg-gray-900 focus:outline-none focus:text-white focus:bg-gray-700">Home</a>
<a href="/contact"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Contact</a>
<a href="/blog"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700">Blog</a>
<a href="#"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"></a>
<a href="#"
class="mt-1 block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700"></a>
</div>
<div class="pt-4 pb-3 border-t border-gray-700">
<div class="flex items-center px-5">
<div class="flex-shrink-0">
<img class="h-10 w-10 rounded-full" src="/images/0.jpeg" alt="My Picture" />
</div>
<div class="ml-3">
<div class="text-base font-medium leading-none text-white">Paolo Trulli</div>
<div class="mt-1 text-sm font-medium leading-none text-gray-400">paolo.g.trulli#gmail.com</div>
</div>
</div>
</div>
</nav>
#yield('content')
</body>
</html>
CONTACT PAGE
#extends('layout')
#section('title', 'Contact')
#section('content')
<div class="bg-gray-700 text-center text-lg full-screen pt-6">
<h1 class="pb-8 text-white text-xl">Contact</h1>
<form action="/contact" method="POST">
<div class="justify-center relative">
<label>
<input class="border-2 border-gray-800 border-black h-10 w-1/4" type='text' placeholder="Name"
autocomplete="off">
</label>
</div>
<div class="justify-center pt-4">
<label>
<input class="border-2 border-gray-800 h-10 w-1/4" type="text" placeholder="Email" autocomplete="off">
</label>
</div>
<div class="justify-center pt-4">
<label>
<input class="border-2 border-gray-800 h-20 w-1/4" type="text" placeholder="Type Text Here"
autocomplete="off">
</label>
</div>
#csrf
<div class="text-center pt-6">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded justify-center">
Submit</button>
<h3 class="pt-6 text-white">I will not SPAM you and your data is Safe!</h3>
<div class="bg-cover content-center flex justify-center min-h-50">
<img src="/images/contact.svg" alt="background image">
</div>
</div>
</form>
#include('footer')
#endsection
HOME PAGE
#extends('layout')
#section('title', 'Home')
#section('content')
<main>
<div class="bg-gray-700 text-center text-gray-200 tracking-wider leading-loose h-full">
<h1 class="pt-6 pb-6 text-lg font-semibold">
A Website Built and Designed By Me!
</h1>
<img class="container-sm mx-auto border-2 border-gray-800" src="/images/0.jpeg">
<p class="pt-6 text-base capitalize font-semibold">
Who am I you ask?
</p>
<div class="inline-flex">
<p class="flex-1"></p>
<p class="flex-1 text-center pt-3 text-justify">
I am a father of two, a husband of one, and someone who loves to build things. I tend to find
something I enjoy
get obsessed with it, and ditch if for something new. Rinsing and Repeating the process. My latest
obsession, in
case you didn't notice, creating this website by programming it myself. I have been diving deep into the
world
of coding, although it takes time to learn, and the many frustrating issues along the way, I can say for
certain
I love to learn and build.
</p>
<p class="flex-1"></p>
</div>
<p class="text-center pt-6 capitalize font-semibold">
So what will this site be or provide?</p>
<div class="inline-flex pt-3">
<p class="flex-1"></p>
<p class="flex-1 text-justify">
I plan to blog about
various topics that interest me. Topics will be random, interesting, and makes me curious. Also, I will
use
this site to showcase a portfolio of work I complete, beginning with this website and adding projects as
I
go.
</p>
<p class="flex-1"></p>
</div>
</div>
</div>
</main>
#include('footer')
#endsection
Lastly BLOG PAGE
#extends('layout')
#section('title', 'Blog')
#section('content')
<main>
<div class="bg-gray-700 text-center text-gray-700 h-screen text-lg">
<h3 class='text-gray-300 pt-6 text capitalize'>A place where I create posts on random things that interest me
</h3>
<div class="pt-6">
<form action="/blog" method="post">
</div>
<label class=""></label>
<input type="text" name="title" autocomplete="off">
#csrf
<div class="text-center pt-6">
<button
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded justify-center">
Add Blog Post</button>
</div>
</form>
<p style="color: red">#error('title') {{ $message }} #enderror</p>
<ul>
#forelse ($blogs as $blog)
<li>{{ $blog->title }}</li>
#empty
<li>
<h3 class="text-center pt-4 text-red-500">No Blog Posts Yet</h3>
</li>
#endforelse
</ul>
</div>
</div>
</main>
#include('footer')
#endsection
Simply, improper html tags. Lesson learned to ensure open and close tags are equal. Because I was short </div> tags my code was suffering and not working as it should.
Credit goes to #kerbholz

TailwindCSS in Next.JS not rendering properly in Webkit

I am using TailwindCSS in a Next.JS project with postcss and autoprefixer. The issue here is it renders fine in Desktop and Chrome for Android, and Firefox. In iOS though both on Safari as well as chrome, the UI gets messed up.
I tried a lot of autoprefixer configs. None of them worked. This problem exists only with webkit. I thought maybe because of the flex, but other flexes on the same page work fine.
Here's the Minimal repo to reproduce the error.
https://github.com/RohithCIS/tailwind-nextjs-webkit-issue
I have attached the images below.
Here's my configs and thanks for the help.
// postcss.config.js
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer')
]
}
// tailwind.config.js
module.exports = {
theme: {
extend: {
borderRadius: {
'xl': '30px'
},
colors: {
grapefruit: '#da4453',
bittersweet: '#e9573f',
bluejeans: '#4a89dc',
lavander: '#967adc',
sunflower: '#f6bb42',
grass: '#8cc152',
pinkrose: '#d770ad',
lightgray: '#e6e8ed',
mint: '#37bc9b',
aqua: '#3bafda',
mediumgray: '#aab2bd',
darkgray: '#434a54'
}
},
},
variants: {},
plugins: []
}
// next.config.js
const withSass = require('#zeit/next-sass');
module.exports = withSass({});
<section className="flex flex-col items-center lg:mt-5">
<div className="max-w-1200">
<div className="flex flex-col lg:flex-row justify-between lg:p-3 w-full">
{/* PREVIEW PANE */}
<div style={{ flexBasis: 0, flexGrow: 3 }}>
<CarouselProvider
naturalSlideWidth={1}
naturalSlideHeight={1}
totalSlides={3}
className="flex flex-col-reverse lg:flex-row"
>
<div className="flex flex-row lg:flex-col p-3 lg:p-0">
<Dot slide={0} className="thumb-preview border border-gray-300 hover:border-pinkrose rounded lg:mb-3 mr-3 lg:mr-0">
<img className="rounded object-cover h-full w-full" src="https://images.cbazaar.com/images/stones-embellished-royal-blue-saree-sadsfcns2198-u.jpg"></img>
</Dot>
<Dot slide={1} className="thumb-preview border border-gray-300 hover:border-pinkrose rounded lg:mb-3 mr-3 lg:mr-0">
<img className="rounded object-cover h-full w-full" src="https://www.jivaana.com/cache/9d/90/rose-red-saree-and-blush-pink-crop-top_saree_red-baby-pink_151186283056-9d90b1cb5f0ccd4306a0ba39058f8571.jpg"></img>
</Dot>
<Dot slide={2} className="thumb-preview border border-gray-300 hover:border-pinkrose rounded lg:mb-3 mr-3 lg:mr-0">
<img className="rounded object-cover h-full w-full" src="https://images.cbazaar.com/images/stones-embellished-royal-blue-saree-sadsfcns2198-u.jpg"></img>
</Dot>
</div>
{/* <div>
<img className="object-contain" src="https://images.cbazaar.com/images/stones-embellished-royal-blue-saree-sadsfcns2198-u.jpg"></img>
</div> */}
<div className="w-full lg:mx-3">
<Slider>
<Slide index={0}><ImageWithZoom src="https://images.cbazaar.com/images/stones-embellished-royal-blue-saree-sadsfcns2198-u.jpg"></ImageWithZoom></Slide>
<Slide index={1}><ImageWithZoom src="https://www.jivaana.com/cache/9d/90/rose-red-saree-and-blush-pink-crop-top_saree_red-baby-pink_151186283056-9d90b1cb5f0ccd4306a0ba39058f8571.jpg"></ImageWithZoom></Slide>
<Slide index={2}><ImageWithZoom src="https://images.cbazaar.com/images/stones-embellished-royal-blue-saree-sadsfcns2198-u.jpg"></ImageWithZoom></Slide>
</Slider>
</div>
</CarouselProvider>
</div>
{/* DETAILS PANE */}
<div style={{ flexBasis: 0, flexGrow: 4 }} className="flex flex-col p-5 pt-0 rounded-lg">
<span className="text-base lg:text-xl text-darkgray">Blue Gray and Gold Coloured Netted Cotton Saree | Straight from Weavers</span>
<div className="flex flex-col lg:flex-row">
<div className="flex flex-col">
<div className="flex justify-between flex-row-reverse items-start lg:flex-col">
<div className='flex flex-row items-center'>
<StarRatingComponent className="text-3xl"
name="rate1"
starCount={5}
value={4}
starColor={'#d770ad'}
/>
<span className="text-dark-gray ml-5 text-xs">231 Ratings<br />10 Reviews</span>
</div>
<div>
<div className="lg:mt-5">
<span className="text-4xl text-pinkrose">₹{store.price}</span>
<span className="text-gray-500 line-through ml-2">₹{store.originalPrice}</span>
</div>
<span className="text-darkgray text-sm">+ ₹100 Shipping</span>
</div>
</div>
<span className="text-xs font-bold mt-3 lg:mt-5 p-1 text-darkgray">Select Variant</span>
<div className="variants flex flex-row items-center text-darkgray">
<div>
<input className="variant hidden" type="radio" name="variant" value="variant1" id="variant1" onChange={this.handleVariantChange} defaultChecked></input>
<label htmlFor="variant1">
<span className="text-xs border border-pinkrose p-1 mr-2 rounded cursor-pointer">With Kit</span>
</label>
</div>
<div>
<input className="variant hidden" type="radio" name="variant" value="variant2" id="variant2" onChange={this.handleVariantChange}></input>
<label htmlFor="variant2">
<span className="text-xs border border-pinkrose p-1 mr-2 rounded cursor-pointer">Without Kit</span>
</label>
</div>
</div>
</div>
<div className="flex flex-row lg:flex-col items-center justify-between lg:justify-center mt-5 lg:mt-0" style={{ flexGrow: 1 }}>
<button className="text-white bg-pinkrose hover:bg-lavander hover:shadow-none p-3 rounded mb-3 shadow-lg w-full lg:w-48 mr-2 lg:mr-0">Add to Cart</button>
<button className="text-white bg-pinkrose hover:bg-lavander hover:shadow-none p-3 rounded mb-3 shadow-lg w-full lg:w-48 ml-2 lg:ml-0">Buy Now</button>
</div>
</div>
<div className="flex flex-col mt-5 text-darkgray">
<span className="text-xs font-bold p-1">Description</span>
<p className="p-1 text-sm">This is a beautiful netted cotton saree, with patch work along the zari embedded with beautiful gold and silver stone work. Comes with a contast blouse. The suggested designs below work really well with the saree.</p>
</div>
</div>
</div>
<div className="text-darkgray p-5 pt-0 flex flex-col lg:flex-row">
{/* SPECS PANE */}
<div style={{ flexBasis: 0, flexGrow: 3 }}>
<span className="text-xs font-bold p-1">Specifications</span>
<table className="border border-gray-400 border-collapse w-full mt-5">
<thead>
<tr>
<th className="p-1 border-b border-gray-400 text-left text-sm bg-gray-200">Specification</th>
<th className="p-1 border-b border-gray-400 text-left text-sm">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td className="p-1 text-sm bg-gray-200">Length</td>
<td className="p-1 text-sm">8 Yards</td>
</tr>
<tr>
<td className="p-1 text-sm bg-gray-200">Cloth Type</td>
<td className="p-1 text-sm">Netted Cotton</td>
</tr>
</tbody>
</table>
</div>
{/* REVIEWS PANE */}
<div className="mt-5 lg:p-5 lg:pt-0 lg:mt-0" style={{ flexBasis: 0, flexGrow: 4 }}>
<span className="text-xs font-bold p-1">Reviews</span>
<div className="flex flex-row py-5 items-start border-b border-gray-400">
<div className="flex flex-col items-center">
<img src="https://i.pravatar.cc/300" className="w-10 h-10 rounded-full" />
</div>
<div className="flex flex-col px-3 flex-grow">
<span className="font-bold text-sm">Write Your Review</span>
<span className="text-xs">John Doe</span>
<input placeholder="Review Title" className="rounded bg-gray-200 text-sm mt-3 p-2"/>
<textarea placeholder="Write your Review here" className="rounded bg-gray-200 text-sm mt-3 p-2" rows="3"/>
<button className="rounded shadow-lg bg-pinkrose text-white px-2 py-1 w-1/3 lg:w-1/5 mt-3">Submit</button>
</div>
</div>
<div className="flex flex-row py-5 items-start border-b border-gray-400">
<div className="flex flex-col items-center">
<img src="https://i.pravatar.cc/300" className="w-10 h-10 rounded-full" />
<span className="px-2 mt-2 rounded bg-sunflower font-bold text-white text-sm">3.5 ★</span>
</div>
<div className="flex flex-col px-3">
<span className="font-bold text-sm">Awesome Saree, Thoroughly Enjoyed Wearing It.</span>
<span className="text-xs">John Doe</span>
<p className="text-sm mt-1">
This was a great saree. I gifted it to myself on my birthday. Prompt Delivery and Great Collection.
</p>
</div>
</div>
</div>
</div>
</div>
</section>
Found the problem. The CSS in JS was the problem. With Tailwind's flex-col and this, safari shrunk the content to fit it. Hence the overlap. Removed CSS in JS and moved it to a Sass file with media queries and loaded them with next-sass.
<div style={{ flexBasis: 0, flexGrow: 3 }}>
...
</div>
<div style={{ flexBasis: 0, flexGrow: 4 }}>
...
</div>
Totally my fault.