Skip to content

Using Sass Placeholders for proper use of @extend#5080

Open
digitalkaoz wants to merge 1 commit intoDogfalo:masterfrom
digitalkaoz:patch-1
Open

Using Sass Placeholders for proper use of @extend#5080
digitalkaoz wants to merge 1 commit intoDogfalo:masterfrom
digitalkaoz:patch-1

Conversation

@digitalkaoz
Copy link
Copy Markdown

@digitalkaoz digitalkaoz commented Aug 7, 2017

this PR exposes all grid related class (.row, .col, s1-12, m1-12, l1-12) as Sass Placeholders:

%row, %l17...

see this http://12devs.co.uk/articles/semantic-grids-with-sass-loops-and-silent-placeholders/ for a proper explanation

this avoids extremely large selector chains when using the materialize grid classes in your sass files:

//bad
.my-row {
  @extend .row;
  
  .my-col {
    @extend .col;

    &.my-s7 {
       @extend .s7;
    }
  }
}

//good 
.my-row {
  @extend %row;
  
  .my-col {
    @extend %col;

    &.my-s7 {
       @extend %s7;
    }
  }
}

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist:

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@DanielRuf
Copy link
Copy Markdown
Contributor

There is an error. Please keep an eye on the tests.

@digitalkaoz digitalkaoz changed the title Using Sass Placeholders for proper use of @extends Using Sass Placeholders for proper use of @extend Aug 9, 2017
@digitalkaoz
Copy link
Copy Markdown
Author

@DanielRuf fixed it, creating PRs through the github is not always cool ;)

this PR exposes all grid related class (`.row`, `.col`, `s1-12`, `m1-12`, `l1-12`) als Sass Placeholders:

`%row`, `%l17`...

see this http://12devs.co.uk/articles/semantic-grids-with-sass-loops-and-silent-placeholders/ for a proper explanation

this avoids extremly large selector chains when using the materialize grid classes in your sass files:

```sass
.my-row {
  @extend %row;

  .my-col {
    @extend %col;

    &.s7 {
       @extend %s7;
    }
  }
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants