Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Triple ampersand in Sass

What does three ampersands do in Sass?

Here in a styled-components context:

const Grid = styled.div`
  display: grid;
  &&& {
    ${someFunction}
  }
`

Seen in code here: https://github.com/reakit/reakit/blob/website%400.16.0/packages/reakit/src/Grid/Grid.ts#L23

like image 670
Fellow Stranger Avatar asked May 28 '19 12:05

Fellow Stranger


1 Answers

The docs say it is to override any already given styles with a higher specificity, as an alternative to using !important.

It affects the generated css classes.

like image 84
Slawomir Chodnicki Avatar answered Sep 28 '22 07:09

Slawomir Chodnicki