Giter VIP home page Giter VIP logo

reusable-html-components's Introduction

Reusable HTML Components

This repository was made to examine an issue with utilizing Shadow DOMs to create HTML components. In the given case, Shadow DOMs were intended to prevent the header & footer components' from overwriting each others' custom CSS.

For things to go as expected, social media links should be showing in the bottom right, as you can see in the picture, below: howIPictured

However, once a Shadow DOM is introduced, they disappear, as illustrated in my original /index.html howItsGoing

Solutions

Handling these shadow DOMs came down to 3 options(you can just read about them in Kris's article, cited under Sources)

SOURCES

This entire repository is owed to the wonderful article that taught me everything, here: Resuable-html-components, by Kris Koishigawa

reusable-html-components's People

Contributors

markpuchalaii avatar

Watchers

James Cloos avatar  avatar

reusable-html-components's Issues

Shadow DOMs block EVERYTHING! Not just each others' CSS

index.html is utilizing a reusable footer component to display its footer, which has been placed in its own shadow DOM to prevent its CSS from changing other elements on the page.
This has, however, resulted in the footer being unable to render the social media icons brought in from the page's font-awesome link.

I've created indexWithoutShadowDOM.html for an easy image of what things should look like.

I can't shake the feeling that it would be redundant to simply place an font-awesome link into the component,
as that would result in rendering two links to the same page for the webpage that this component's being applied to.

I wonder if the question is: How do we link to an external CSS sheet on the webpage, and not on a reusable component in a shadow DOM, all while ensuring the shadow DOM can still get what it needs from that same external CSS link?

I worry that this question is just another way of wording "let the webpage end up with two links to the same sheet".

So that's why I think this is currently beyond my skills.
Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.