From 2c2661c0fb11874fa7ffb579762cdfe316c51f93 Mon Sep 17 00:00:00 2001 From: Shubham Giri Date: Tue, 31 Dec 2024 15:49:16 +0530 Subject: [PATCH] Added CSS snipet for grid layout --- public/data/css.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/public/data/css.json b/public/data/css.json index c0fe61b6..cf65a6a1 100644 --- a/public/data/css.json +++ b/public/data/css.json @@ -21,6 +21,23 @@ { "categoryName": "Layouts", "snippets": [ + { + "title": "Grid layout", + "description": "Equal sized items in a responsive grid", + "code": [ + ".grid-container {", + " display: grid", + " grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));", + "/* Explanation:", + "- `auto-fit`: Automatically fits as many columns as possible within the container.", + "- `minmax(250px, 1fr)`: Defines a minimum column size of 250px and a maximum size of 1fr (fraction of available space).", + "*/", + "}", + "" + ], + "tags": ["css", "layout", "grid"], + "author": "xshubhamg" + }, { "title": "Sticky Footer", "description": "Ensures the footer always stays at the bottom of the page.",