Download react-spring/docs/app/components/AspectRatio.css.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 771 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-spring/docs/app/components/AspectRatio.css.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-spring/docs/app/components/AspectRatio.css.ts
-
curl -L -o AspectRatio.css.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-spring/docs/app/components/AspectRatio.css.ts
771 Bytes
| import { createVar, globalStyle, style } from '@vanilla-extract/css' | |
| export const widthVar = createVar() | |
| export const heightVar = createVar() | |
| export const container = style({ | |
| position: 'relative', | |
| '@supports': { | |
| '(aspect-ratio: 1)': { | |
| overflow: 'hidden', | |
| aspectRatio: `${widthVar} / ${heightVar}`, | |
| }, | |
| 'not (aspect-ratio: 1)': { | |
| ':before': { | |
| paddingTop: `calc((${widthVar} / ${heightVar}) * 100%)`, | |
| display: 'block', | |
| content: '', | |
| width: '100%', | |
| }, | |
| }, | |
| }, | |
| }) | |
| globalStyle(`${container} > *`, { | |
| position: 'absolute', | |
| top: '50%', | |
| left: '50%', | |
| transform: 'translate(-50%, -50%)', | |
| minWidth: '100%', | |
| maxWidth: '100%', | |
| minHeight: '100%', | |
| maxHeight: '100%', | |
| objectFit: 'cover', | |
| }) | |