Missing native aspect ratio classes
Version
@nuxthq/ui: v2.7.0 nuxt: v3.6.5
Steps to reproduce
- Use
aspect-squareclass in a component - Compile Nuxt with
nuxtlab/uiinstalled - Check compiled website in browser, realize that aspect-square class is missing
What is Expected?
We expect use the native classes for aspect ratio over aspect ratio classes from original plugin or find a way to work with both flows properly
What is actually happening?
When we install nuxtlab/ui package we lost all classes working with the native aspect-ratio feature for version 3 of Tailwind,
We identified that nuxlabs/ui use the original package of aspect-ratio as plugin, so we think for that reason is a conflict with the classes
Can you tell me if adding this in your tailwind.config.ts fixes the issue?
{
theme: {
extend: {
aspectRatio: {
auto: 'auto',
square: '1 / 1',
video: '16 / 9'
}
}
}
}
Hi @benjamincanac, that solves the main problem, but I need to do this in every new project?, I understand that new Aspect Ratio feature is part of the tailwind core and I don't need to do this configuration.
I think it's better to keep using the plugin instead of the native core one for now from what I understand from this section: https://github.com/tailwindlabs/tailwindcss-aspect-ratio#compatibility-with-default-aspect-ratio-utilities
Hi @benjamincanac I got it, thanks for your time!
Can we write about this somewhere in the docs? I was so confused because these values did not work @benjamincanac
I'm not sure that "Safari 14 still has significant global usage" still applies. Today it looks to be barely over 1% combined desktop and mobile. Screenshots from caniuse:
https://caniuse.com/mdn-css_properties_aspect-ratio
as a stop-gap solution I'm going to update our themes to use the aspect-[1/1] syntax rather than aspect-square since that will allow us to achieve compatibility with Nuxt UI without requiring users to install a plugin or update their TW config files.