Skip to content

Commit

Permalink
[style] Force uniform style
Browse files Browse the repository at this point in the history
  • Loading branch information
xymopen committed Nov 15, 2019
1 parent ff9cc54 commit a83ced2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/mixins/function.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@function selectorToString($selector) {
$selector: inspect($selector);
$selector: str-slice($selector, 2, -2);

@return $selector;
}

Expand All @@ -22,23 +23,22 @@
$selector: selectorToString($selector);

@if str-index($selector, '.' + $state-prefix) {
@return true
@return true;
} @else {
@return false
@return false;
}
}

@function containPseudoClass($selector) {
$selector: selectorToString($selector);

@if str-index($selector, ':') {
@return true
@return true;
} @else {
@return false
@return false;
}
}

@function hitAllSpecialNestRule($selector) {

@return containsModifier($selector) or containWhenFlag($selector) or containPseudoClass($selector);
}
15 changes: 7 additions & 8 deletions src/mixins/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@
-------------------------- */
@mixin placeholder {
&::-webkit-input-placeholder {
@content
@content;
}

&::-moz-placeholder {
@content
@content;
}

&:-ms-input-placeholder {
@content
@content;
}
}

Expand Down Expand Up @@ -140,7 +140,7 @@

@at-root {
#{&}#{$specSelector}.#{$block+$element-separator+$element+$modifierCombo} {
@content
@content;
}
}
}
Expand All @@ -156,7 +156,7 @@
@at-root {
#{$selector} {
.#{$block+$element-separator+$element+$modifierCombo} {
@content
@content;
}
}
}
Expand All @@ -178,13 +178,12 @@
$rule-name: '%shared-'+$name;

@at-root #{$rule-name} {
@content
@content;
}
}

@mixin pseudo($pseudo) {
@at-root #{&}#{':#{$pseudo}'} {
@content
@content;
}
}

0 comments on commit a83ced2

Please sign in to comment.