Skip to content

Collection of CSS Snippets to make your life easier by auto-completing css rules.

License

NotificationsYou must be signed in to change notification settings

navin-moorthy/vscode-css-snippets

Repository files navigation

VSCode CSS Snippets

Cover

Description

Collection of CSS Snippets to make your life easier by auto-completing common css rules, Tailwind utility classes as css rules - Tailwind and 1 line layouts

It's not debatable, most of us got used to utility classes from Tailwind, BootStrap etc,. But when you come back to write plain CSS, wouldn't be great to have those utility classes converted as snippets instead of typing the CSS rules?

Apart from CSS Utility snippets, collection of snippets from popular CSS examples found all over the web can be found.

To see the list of all the CSS Snippets, go here →

Want to have your own favourite CSS Snippets in this extension, see Contributing →

Tailwind Layout snippets Showcase

Installation

Install via the Visual Studio Code Marketplace →

You can enable tab completion (recommended) by opening Code > Preferences > Settings (on a Mac) and applying "editor.tabCompletion": "onlySnippets" to your personal settings

Table of Contents

Snippets

Common

CSS Reset

SnippetPurpose
css-resetAn opinionated set of base styles Cloned from Tailwind Preflight - Original File

Pseudo Styles

SnippetPurpose
hover:hover
focus:focus
active:active
disabled:disabled
visited:visited
first:first-child
last:last-child
even:nth-child(2n)
odd:nth-child(odd)
nth-child:nth-child(rule)
SnippetPurpose
respGet all tailwind breakpoints - 640px - 768px - 1024px - 1280px
resp-smGet tailwind breakpoint - sm - 640px
resp-mdGet tailwind breakpoint - md - 768px
resp-lgGet tailwind breakpoint - lg - 1024px
resp-xlGet tailwind breakpoint - xl - 1280px
resp-selectedGet all tailwind breakpoints for selected class/classes - 640px - 768px - 1024px - 1280px See how →
resp-sm-selectedGet tailwind breakpoint for selected class/classes - sm - 640px See how →
resp-md-selectedGet tailwind breakpoint for selected class/classes - md - 768px See how →
resp-lg-selectedGet tailwind breakpoint for selected class/classes - lg - 1024px See how →
resp-xl-selectedGet tailwind breakpoint for selected class/classes - xl - 1280px See how →

Layout Snippets

List of all Layout Snippets →

Layout Snippets Showcase

FlexBox Snippets

List of all FlexBox Snippets →

FlexBox Snippets Showcase

Grid Snippets

List of all Grid Snippets →

Grid Snippets Showcase

Spacing Snippets

List of all Spacing Snippets →

Spacing Snippets Showcase

Learn 1linelayouts in detail from Web Dev →

1 line layout usage

SnippetPurpose
super-centeredplace-items: center;
deconstructed-pancakeflex: 0 1 baseWidth};
sidebar-saysgrid-template-columns: minmax(min, max) ...};
pancake-stackgrid-template-rows: auto 1fr auto;
classic-holy-grail-layoutgrid-template: auto 1fr auto / auto 1fr auto;
12-span-gridgrid-template-columns: repeat(12, 1fr);
ramgrid-template-columns: repeat(auto-fit, minmax(base, 1fr));
line-upjustify-content: space-between;
clamping-my-styleclamp(min, actual, max);
respect-for-aspectaspect-ratio: width / height};

Extra Guides

Snippets generation from Selected line/lines

Guide on how to utilize selected lines in snippets

Contributing

This is an Open Source Project with MIT License.

You can also contribute to this extension by adding your own list of CSS Snippets which you think will help others increase their productivity.

See Contributing Docs → for detailed guidance.

Attributions

Snippet Ideation:

Snippet Generation:

Docs Inspiration:

Contributing Inspiration:

Huge thanks 🙏: to above wonderful persons for creating awesome projects which helped me build this project.