Skip to content

Commit

Permalink
Fix bug to allow for null value in $speed list values
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonmcconnell committed Oct 19, 2021
1 parent 1c10227 commit 35c72a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

The SCSS Typewriter is a fully functional typewriter mixin for SCSS.

![demonstration of SCSS typewriter in action](http://i.imgur.com/OUkLi.gif)
<div align="center">[Live Demo](http://i.imgur.com/OUkLi.gif)</div>

## Syntax

```scss
Expand Down Expand Up @@ -66,7 +69,7 @@ Properties of the `$options` map can only be overwridden using another object of
```
**Type two strings, adjust the speed of `type` and `pause-deleted` properties** (2 methods)
```scss
@include typewriter("String 1", "String 2", [.1, null, null, .5]);
@include typewriter("String 1", "String 2", [.1, null, null, .5]);
```
```scss
@include typewriter("String 1", "String 2", (type: .1, pause-deleted: .5));
Expand Down
4 changes: 2 additions & 2 deletions typewriter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $__typewriter-id: 0;
@error "The speed list argument only accepts 4 numbers when used a list.";
}
@for $i from 1 through length($parameter) {
@if type-of(nth($parameter, $i)) != number {
@if nth($parameter, $i) != null and type-of(nth($parameter, $i)) != number {
@error "The value #{$value} is not a number.";
}
@if nth($parameter, $i) != null {
Expand Down Expand Up @@ -128,7 +128,7 @@ $__typewriter-id: 0;
$animationName: #{map-get($options, name)};
} @else {
$animationName: typewriter-#{$__typewriter-id};
$__typewriter-id: $__typewriter-id + 1;
$__typewriter-id: $__typewriter-id + 1 !global;
}
$charCount: 0;
$durTotal: 0;
Expand Down

0 comments on commit 35c72a1

Please sign in to comment.