πŸͺΊ CSS Nesting Generator

Flat CSS ↔ CSS Nesting Converter

βš™οΈ Options

Examples:

πŸ“₯ Input CSS

πŸ“€ Output

0 lines
Click "To Nested" or "Expand to Flat" to see result

πŸ’‘ About CSS Nesting

CSS Nesting is a native CSS feature (CSS Nesting Module Level 1) that lets you nest style rules within other rules. Use the & symbol to reference the parent selector. Example:

.card {
  background: #fff;
  & .title { font-size: 1.2rem; }
  &:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
}

πŸ“Œ Note: CSS Nesting requires nested selectors to start with &, ., #, :, [, >, +, or ~.

βœ… Copied to clipboard!