u/riti_rathod

▲ 0 r/css

The easiest way to vertically center a div

If you're centering content inside a container, Flexbox is usually the simplest solution.

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

Why it works -

  • align-items: center → vertical alignment
  • justify-content: center → horizontal alignment
  • height: 100vh → full viewport height
reddit.com
u/riti_rathod — 3 days ago
▲ 79 r/css

This one-line CSS trick fixes page jumping when scrollbars appear

If your layout shifts a few pixels when a scrollbar appears, this helps:

body {
  scrollbar-gutter: stable;
}

Such a tiny property, but it makes the UI feel much smoother.

Modern CSS keeps solving problems we used to hack around for years.

reddit.com
u/riti_rathod — 6 days ago
▲ 13 r/css

Are you using the CSS :has() selector yet?

I have been experimenting with the :has() selector recently and it honestly changes how I think about CSS selectors.

Example:

.container:has(.active) {
background: #111;
}

Feels like CSS finally got a real parent selector.

reddit.com
u/riti_rathod — 8 days ago
▲ 51 r/css

Tiny CSS feature that helps reduce repeated color values

Was exploring some CSS tricks recently and found currentColor.

It automatically uses the element’s current text color for other properties.

button {
  color: tomato;
  border: 2px solid currentColor;
}

So instead of repeating the same hex value everywhere, the border just follows the text color automatically. Pretty useful for buttons, icons, SVGs, hover states, theme systems

Small feature, but makes CSS feel cleaner.

reddit.com
u/riti_rathod — 9 days ago

I’ve been trying to rely less on the mouse in VS Code and more on shortcuts lately, and honestly, it makes a noticeable difference once you get used to it.

So I just wanted to share a simple cheat sheet of the shortcuts I use most while working with Windows + macOS.

What are your most-used VS Code shortcuts that you can’t live without?

u/riti_rathod — 20 days ago
▲ 144 r/vscode+1 crossposts

I’ve been trying to rely less on the mouse in VS Code and more on shortcuts lately, and honestly, it makes a noticeable difference once you get used to it.

So I just wanted to share a simple cheat sheet of the shortcuts I use most while working with Windows + macOS.

What are your most-used VS Code shortcuts that you can’t live without?

u/riti_rathod — 20 days ago

I want something:

  • Easy to use (not too complicated like full editing software)
  • Good for short, clean, modern videos
  • Can animate text and UI/visual elements

Free tools are great, but I’m okay with paid ones if they’re worth it.

If you’ve used any good tools for this, please share

reddit.com
u/riti_rathod — 23 days ago

I want something:

  • Easy to use (not too complicated like full editing software)
  • Good for short, clean, modern videos
  • Can animate text and UI/visual elements

Free tools are great, but I’m okay with paid ones if they’re worth it.

If you’ve used any good tools for this, please share

reddit.com
u/riti_rathod — 23 days ago