Skip to content

Commit

Permalink
Namespace for sass variable #68
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Nov 3, 2017
1 parent 6edd990 commit 74ed722
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,21 +428,21 @@ If you use a sass loader you could replace the default variable to suits your ne

```css
/* Below the variable you can replace */
$toast-width: 320px !default;
$toast-background: #ffffff !default;
$font-color: #999 !default;
$font-size: 13px !default;
$animation-duration: 0.75s !default;
$rt-toast-width: 320px !default;
$rt-toast-background: #ffffff !default;
$rt-font-color: #999 !default;
$rt-font-size: 13px !default;
$rt-animation-duration: 0.75s !default;

$color-default: #fff !default;
$color-info: #3498db !default;
$color-success: #07bc0c !default;
$color-warning: #f1c40f !default;
$color-error: #e74c3c !default;
$rt-color-default: #fff !default;
$rt-color-info: #3498db !default;
$rt-color-success: #07bc0c !default;
$rt-color-warning: #f1c40f !default;
$rt-color-error: #e74c3c !default;

$color-progress-default: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55) !default;
$rt-color-progress-default: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55) !default;

$smartphone-portrait: "only screen and (max-width : 480px)" !default;
$rt-smartphone-portrait: "only screen and (max-width : 480px)" !default;
```

- Include the file and voila!
Expand Down
2 changes: 1 addition & 1 deletion dist/ReactToastify.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/scss/_animation.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "animations/bounce";

.toastify-animated {
animation-duration: $animation-duration;
animation-duration: $rt-animation-duration;
animation-fill-mode: both;
}

Expand Down
8 changes: 4 additions & 4 deletions src/scss/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
z-index: 999;
position: fixed;
padding: 4px;
width: $toast-width;
width: $rt-toast-width;
box-sizing: border-box;
color: #fff;
&--top-left {
Expand All @@ -13,7 +13,7 @@
&--top-center {
top: 1em;
left: 50%;
margin-left: -($toast-width / 2);
margin-left: -($rt-toast-width / 2);
}
&--top-right {
top: 1em;
Expand All @@ -27,7 +27,7 @@
&--bottom-center {
bottom: 1em;
left: 50%;
margin-left: -($toast-width / 2);
margin-left: -($rt-toast-width / 2);
}
&--bottom-right {
bottom: 1em;
Expand All @@ -36,7 +36,7 @@

}

@media #{$smartphone-portrait} {
@media #{$rt-smartphone-portrait} {
.toastify{
width: 100vw;
padding: 0;
Expand Down
12 changes: 6 additions & 6 deletions src/scss/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
font-family: sans-serif;
cursor: pointer;
&--default {
background: $color-default;
background: $rt-color-default;
color: #aaa;
}
&--info {
background: $color-info;
background: $rt-color-info;
}
&--success {
background: $color-success;
background: $rt-color-success;
}
&--warning {
background: $color-warning;
background: $rt-color-warning;
}
&--error {
background: $color-error;
background: $rt-color-error;
}
}

Expand All @@ -35,7 +35,7 @@
flex: 1;
}

@media #{$smartphone-portrait} {
@media #{$rt-smartphone-portrait} {
.toastify-content{
margin-bottom: 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
animation: track-progress linear 1;
background-color: rgba(255,255,255,.7);
&--default{
background: $color-progress-default;
background: $rt-color-progress-default;
}
&--info{}
&--success{}
Expand Down
24 changes: 12 additions & 12 deletions src/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
$toast-width: 320px !default;
$toast-background: #ffffff !default;
$font-color: #999 !default;
$font-size: 13px !default;
$animation-duration: 0.75s !default;
$rt-toast-width: 320px !default;
$rt-toast-background: #ffffff !default;
$rt-font-color: #999 !default;
$rt-font-size: 13px !default;
$rt-animation-duration: 0.75s !default;

$color-default: #fff !default;
$color-info: #3498db !default;
$color-success: #07bc0c !default;
$color-warning: #f1c40f !default;
$color-error: #e74c3c !default;
$rt-color-default: #fff !default;
$rt-color-info: #3498db !default;
$rt-color-success: #07bc0c !default;
$rt-color-warning: #f1c40f !default;
$rt-color-error: #e74c3c !default;

$color-progress-default: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55) !default;
$rt-color-progress-default: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55) !default;

$smartphone-portrait: "only screen and (max-width : 480px)" !default;
$rt-smartphone-portrait: "only screen and (max-width : 480px)" !default;

0 comments on commit 74ed722

Please sign in to comment.