A fully functional and flexible typewriter mixin for SCSS, with Less and Stylus support coming soon! Typed.css supports multiple strings, multi-line strings, variable speeds, per-string styling, animated caret (blinking insertion cursor), directional type-pausing, and much more. It's even accessible! ✨
end-on
string (fixes #15, thanks @greyskin for the report! 🙌🏼)
Full Changelog: https://github.com/brandonmcconnell/typed.css/compare/v0.8.6...v0.8.9
The project has been on pause for the past month or so, but it's moving strongly once again!
With Safari Technology Preview 136 adding support for discrete animation of the content property (release notes), it's only a matter of time—likely weeks or a couple of months—until pure CSS animated text is universally supported across all modern browsers.
With this update, I wanted to make a few strides that will allow this project to become more public-ready. These updates include:
typed.css
, formerly scss-typewriter
The project has been on pause for the past month or so, but it's moving strongly once again!
With Safari Technology Preview 136 adding support for discrete animation of the content property (release notes), it's only a matter of time—likely weeks or a couple of months—until pure CSS animated text is universally supported across all modern browsers.
With this update, I wanted to make a few strides that will allow this project to become more public-ready. These updates include:
typed.css
, formerly scss-typewriter
This release resolves a bug where the added type-pausing improvements typed the literal key of each space type fwd
, bwd
or both
instead of the appropriate zero-width space character for each.
Updated README to include basic installation instructions. Intend to improve installation instructions at a later date.
v0.8.0 ushers in a MASSIVE refactorization to the original architecture. Much of the work done was purely algorithmic and will not affect the way in which users utilize the typewriter mixin— which is crazy as I've spent the past 12 hours slaving over this new version but hey, that's engineering #TheBurnoutIsReal 🥲
So what are these updates exactly? Well first off, v0.8.0 expands upon the usage of type-pausing to add support for ✨directional type-pausing✨. This change, in particular, was the main culprit that caused me to have to rework my entire build, so I've provided a retelling of my full process further down in this release note in case anyone is curious… 👋🏼
type-pausing
property in the $options
map object<[_10]>
, <[10_]>
, <[_10_]>
where <[10]>
without an underscore pauses on forward only by default, though this is configurable using an additionally added type-pausing-default
property on the $options
map objectstyles
property on the $options
map object which adds global styles that will apply to all strings in the animationend-styles
property on the $options
map object which adds styles that will apply to only the very last frame of the end-on
string when the animation is not set to loop continuouslyprefix
property on the $options
map object which adds a prefix to the beginning of each string in the animation— caution: this prefix will adopt per-string styles, per-string, so the style may suddenly shift in undesirable ways.Some text^1000 and some more text
where every time a number follows a caret symbol mid-string, the animation will pause for that many milliseconds while animating forward.<[INTEGER]>
to avoid any conflicts with other modules and packages that use a structure more similar to %{…}
or ${…}
._
before or after the number within the original syntax, representing animating in the forward direction (_
on the left side) or animating in the backward direction (_
on the right side), OR one underscore on each side to support pausing in both directions. A few examples of this would be: <[_10]>
, <[10_]>
, <[_10_]>
$options
map object type-pausing-default
with accepted values fwd
(default), bwd
, and both
. I've also added another boolean option type-pausing
to allow users to determine whether they want to enable type-pausing at all. It is enabled by default.Judging by GitHub's recommendation for semantic versioning, this package should really be somewhere between v1 and v2 already, but what's the fun in rushing version numbers when I haven't even officially published this yet? 🤷🏻♂️
Cheers 🍻
Just pushing a quick fix for a bug that occurred with the v0.5.0 push 👋🏼
SCSS Typewriter has been making some huge strides for the past 48 hours, so I'm finally bumping up the version number to reflect the immense amount of progress that has been made.
This update specifically brings two great new updates:
type-pausing
: (boolean) This boolean value determines whether the current typewriter will replace any/all instances of the special "pause" syntax within its strings with a pause for the duration of however long it would take to type the number of characters indicated by its contained value. This property is set to true by default. The type-pause syntax is <[INTEGER]>
. When enabled, a given string Be right <[3]>there.
the total time it would take to animate the string forward would be the current type
speed duration * 18. The 18 character-durations is comprised of three parts: Be right
(9 chars), <[3]>
(same time as 3 chars), and there.
(6 chars). 9+3+6=18prefix
: (string) This string will displays at the beginning of each typed string and will NOT be included in the animation of the text itself. It's important to note that if you set per-string styles, they cause undesirable effects to the prefix, causing its style to change instantly between strings. In this case, opt to place any prefix/suffix strings outside the animated text element altogether.Still a ways to go before we reach v1.0.0, but I have a laundry list of improvements to make which should get me there soon. I'm shooting for end of next week! 🎉
Coming soon…
bulk-typing
, the ability to chunk more than single characters together for times you may want to print an entire string or a portion of a string togetherstyles
, global styles that apply to all strings including end-on
freeze-end
, ability to freeze animation at the end of the final iteration without relying on end-on
animation-stack
, ability to pass in animation strings to stack atop computed typewriter animation property valueThis update addresses the accessibility-related issue that arose when adding support for alt text. The bug is now resolved.
This update continues the work set forth by v0.1.0 and v0.1.1 and adds additional accessibility-focused support for alt text by adding an alt-text
property to the $options
map object for explicit definition. When unset, this property will—by default—fall back to the value stored in end-on
. If end-on
is also unset, both values will default to the value of the first string passed to the typewriter mixin.
This release also works to further investigate a solution for the bug encountered by nesting @support
at-rule queries under @keyframes
in v0.1.0. As a fallback, an update from v0.1.1 removes the @support
queries and instead stacks the values in order, in hopes that an invalid content
value will fall back to the previous-adjacent content property value.
This is not yet confirmed.