Skip to content

Commit

Permalink
Use a more modern mixin example in the tutorial (#550)
Browse files Browse the repository at this point in the history
Closes #473
  • Loading branch information
nex3 committed May 26, 2021
1 parent 2fb003b commit d9c3c43
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions source/guide.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,36 @@ introduction: >

- example do
:plain
@mixin transform($property) {
-webkit-transform: $property;
-ms-transform: $property;
transform: $property;
@mixin theme($theme: DarkGray) {
background: $theme;
box-shadow: 0 0 1px rgba($theme, .25);
color: #fff;
}

.info {
@include theme;
}
.alert {
@include theme($theme: DarkRed);
}
.success {
@include theme($theme: DarkGreen);
}
.box { @include transform(rotate(30deg)); }
===
=transform($property)
-webkit-transform: $property
-ms-transform: $property
transform: $property
.box
+transform(rotate(30deg))
@mixin theme($theme: DarkGray)
background: $theme
box-shadow: 0 0 1px rgba($theme, .25)
color: #fff


.info
@include theme

.alert
@include theme($theme: DarkRed)

.success
@include theme($theme: DarkGreen)

:markdown
To create a mixin you use the `@mixin` directive and give it a name. We've
Expand Down

1 comment on commit d9c3c43

@torshin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forget to change description of the code. transform -> theme, $property->$theme

Please sign in to comment.