DEV Community

Discussion on: A Typewriter, but using a New HTML Tag

Collapse
 
yw662 profile image
yw662

A great demo to show the power of Web Component APIs. Have been willing to see how these components can change the world.

Collapse
 
yw662 profile image
yw662 • Edited

For me it would be even better if you don't need this:

<link rel="stylesheet" href="https://unpkg.com/@auroratide/typewritten-text/lib/style.css" />
Enter fullscreen mode Exit fullscreen mode
Collapse
 
auroratide profile image
Timothy Foster

Ah yes I did think about this; normally web components define styles in the shadow dom for encapsulation, but I found I couldn't do that here since the characters live in the light dom.

In theory the define.js script could create a style node itself, but in the end I decided to let the developer decide how/when to import the stylesheet, since the preference can differ from app to app.