错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Applying Shadow DOM API in Apps

  • Alex Libby

摘要

Throughout this book, we’ve focused on creating components that use the Shadow DOM API – it’s perfect for encapsulating styles, controlling what we can and can’t override, and generally maintaining consistency – rather than letting others run roughshod over your pride and joy! There is one thing, though – what about using the API generally in sites outside of components? As developers, we would probably create some form of component, but there may be occasions where you want to create something custom (i.e., that is not reusable) yet still want to benefit from using the API. Fortunately, we can use the API anywhere on a site – it’s not limited to just being used in components! In this chapter, I’ve selected three areas to consider, which includes using the API in styling frameworks, or the impact of SEO – we’ll go through some of the pitfalls to watch out for, and learn about how to effectively use them when working with the Shadow DOM API.