1583. tailwind.config.js module.exports = { theme: { extend: { aspectRatio: { '4/3': '4 / 3', }, } } } Thank You:) Solution 1: Remove the flex-wrap and use sm:flex-row flex-col to have flex-direction: column in mobile screen. You can install by: Running this command on your terminal npm install @tailwindcss/aspect-ratio Then add it to your tailwind config: plugins: [ require('@tailwindcss/aspect-ratio'), ], Learn more about how these modifiers work in the Hover, Focus, and Other States documentation. 504), Hashgraph: The sustainable alternative to blockchain, Mobile app infrastructure being decommissioned. This guide covers topics like customizing your design tokens, how to break out of those constraints when necessary, adding your own custom CSS, and extending the framework with plugins. Thanks for contributing an answer to Stack Overflow! The addVariant function allows you to register your own custom modifiers that can be used just like the built-in hover, focus, active, etc. npm package tailwindcss-aspect-ratio, we found that it has been starred 253 times, and that 0 other projects in the ecosystem are dependent on it. Not the answer you're looking for? Utility plugins can provide default values by including a configuration object as the second argument to the plugin function: These values behave just like the values in the default configuration, and can be overridden or extended by the end user. Now to resize the image, we must keep in mind preserving the aspect ratio.. OpenCV Resize image using cv2.resize OpenCV Python - Resize. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Using custom values Customizing your theme By default, Tailwind provides a minimal set of aspect-ratio utilities. Tailwind CSS classes is not working in my project? Does there exist a Coriolis potential, just like there is a Centrifugal potential? Usage.aspect-ratio generates the initial styling, with additional classes for setting the width and height ratios.. Use the matchUtilities function to register utilities that map to values defined in the users theme configuration: Utilities defined this way also support arbitrary values, which means you can use values not present in the theme using square bracket notation: By default, plugin utilities automatically respect the users prefix and important preferences. My question is how can I customise it to let it responsive? Plugins let you register new styles for Tailwind to inject into the users stylesheet using JavaScript instead of CSS. Maintain the aspect ratio of a div with CSS. How to divide an unsigned 8-bit integer by 3 without divide or multiply instructions (or lookup tables). To get started with your first plugin, import Tailwinds plugin function from tailwindcss/plugin. Tailwind has been designed from the ground up to be extensible and customizable, so that no matter what youre building you never feel like youre fighting the framework. Typography, Aspect Ratio, Forms, Line-clamp. Making statements based on opinion; back them up with references or personal experience. 16 min read. This class accepts lots of values in tailwind CSS in which all the properties are covered in class form. How did Space Shuttles get off the NASA Crawler? And this is just the early. You can also add custom styles to your project using Tailwinds plugin system instead of using a CSS file: Learn more about writing your own plugins in the Plugins documentation. When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on stackoverflow.com. You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. Tailwind's plugin system expect CSS rules written as JavaScript objects, using the same sort of syntax you might recognize from CSS-in-JS libraries like Emotion, powered by postcss-js under-the-hood. For example text-lg and text-black both share the text- namespace, but one is for font-size and the other is for color. Aspect ratio classes up to 16 are generated by default: Configuration You can configure which values and variants are generated by this plugin under the aspectRatio key in your tailwind.config.js file: How does White waste a tempo in the Botvinnik-Carls defence in the Caro-Kann? How to maximize hot water production given my electrical panel limits on available amperage? If a tailwind.config file is present, it will be imported and used to overwrite the default configuration. tailwind.config.js module.exports = { theme: { extend: { aspectRatio: { '4/3': '4 / 3', }, } } } Tailwind CSS documentation provides free sample components. Component frameworks like Vue and Svelte support adding per-component styles within a