How do you use Bootstrap with Lit-Element?How can I get my Twitter Bootstrap buttons to right align?Change navbar color in Twitter BootstrapWhat is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?How to import popper.js?Bootstrap 4 tab.js active states stuckPurpose of the “$=” or “?=” in lit-element examplesHow do I consume a polymer lit-element?Bootstrap popper.js Failed to find a valid digest in the 'integrity' attribute for resourceLit-Element: which event to use for DOM updates?How to test Web Component (lit-element) with jest

The 100 soldier problem

I feel like most of my characters are the same, what can I do?

Linear independence of element-wise powers of positive vectors

How can I get a language selector in top bar in Ubuntu 19.04?

How is the problem, G has no triangle in Logspace?

I was cheated into a job and want to leave ASAP, what do I tell my interviewers?

Is there any actual security benefit to restricting foreign IPs?

I reverse the source code, you negate the input!

Reaction of aqueous sodium carbonate with aluminum foil

Microservices and Stored Procedures

Do household ovens ventilate heat to the outdoors?

Safely hang a mirror that does not have hooks

Simulate a 1D Game-of-Life-ish Model

Nanomachines exist that enable Axolotl-levels of regeneration - So how can crippling injuries exist as well?

Do things made of adamantine rust?

What's the purpose of autocorrelation?

Create a magic square of 4-digit numbers

What are the end bytes of *.docx file format

Is it really necessary to have 4 hours meeting in Sprint planning?

Debussy as term for bathroom?

Manager manipulates my leaves, what's in it for him?

Can Northern Ireland's border issue be solved by repartition?

Can multiple wall timers turn lights on or off when required?

Would a flying character fall prone after dashing if they had lost a leg?



How do you use Bootstrap with Lit-Element?


How can I get my Twitter Bootstrap buttons to right align?Change navbar color in Twitter BootstrapWhat is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?How to import popper.js?Bootstrap 4 tab.js active states stuckPurpose of the “$=” or “?=” in lit-element examplesHow do I consume a polymer lit-element?Bootstrap popper.js Failed to find a valid digest in the 'integrity' attribute for resourceLit-Element: which event to use for DOM updates?How to test Web Component (lit-element) with jest






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I would like to make use of Lit-Element with Bootstrap.



Currently I have simply imported the external dependancies as suggested here: https://lit-element.polymer-project.org/guide/styles#external-stylesheet



Is there a better way to import these 3rd party dependancies?



Here is my component:



import LitElement, html, css from "../../../third-party-libs/lit-element.js"

class LoginError extends LitElement
static get properties()
return
show: type: Boolean, reflect: true



static get styles()
return css`
div
color: red;

.hide-me
visibility: hidden

`;


constructor()
super();
this.show = false


render()
return html`
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>


<div class="invalid-credentials mb-3 animated $ this.show ? "shake" : "hide-me"">
Invalid credentials, please try again
</div>
`



customElements.define('login-error', LoginError)


I would appreciate any advice on how to clean this up, and how to share this code with multiple components.










share|improve this question






























    2















    I would like to make use of Lit-Element with Bootstrap.



    Currently I have simply imported the external dependancies as suggested here: https://lit-element.polymer-project.org/guide/styles#external-stylesheet



    Is there a better way to import these 3rd party dependancies?



    Here is my component:



    import LitElement, html, css from "../../../third-party-libs/lit-element.js"

    class LoginError extends LitElement
    static get properties()
    return
    show: type: Boolean, reflect: true



    static get styles()
    return css`
    div
    color: red;

    .hide-me
    visibility: hidden

    `;


    constructor()
    super();
    this.show = false


    render()
    return html`
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>


    <div class="invalid-credentials mb-3 animated $ this.show ? "shake" : "hide-me"">
    Invalid credentials, please try again
    </div>
    `



    customElements.define('login-error', LoginError)


    I would appreciate any advice on how to clean this up, and how to share this code with multiple components.










    share|improve this question


























      2












      2








      2


      1






      I would like to make use of Lit-Element with Bootstrap.



      Currently I have simply imported the external dependancies as suggested here: https://lit-element.polymer-project.org/guide/styles#external-stylesheet



      Is there a better way to import these 3rd party dependancies?



      Here is my component:



      import LitElement, html, css from "../../../third-party-libs/lit-element.js"

      class LoginError extends LitElement
      static get properties()
      return
      show: type: Boolean, reflect: true



      static get styles()
      return css`
      div
      color: red;

      .hide-me
      visibility: hidden

      `;


      constructor()
      super();
      this.show = false


      render()
      return html`
      <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
      <!-- jQuery first, then Popper.js, then Bootstrap JS -->
      <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
      <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>


      <div class="invalid-credentials mb-3 animated $ this.show ? "shake" : "hide-me"">
      Invalid credentials, please try again
      </div>
      `



      customElements.define('login-error', LoginError)


      I would appreciate any advice on how to clean this up, and how to share this code with multiple components.










      share|improve this question














      I would like to make use of Lit-Element with Bootstrap.



      Currently I have simply imported the external dependancies as suggested here: https://lit-element.polymer-project.org/guide/styles#external-stylesheet



      Is there a better way to import these 3rd party dependancies?



      Here is my component:



      import LitElement, html, css from "../../../third-party-libs/lit-element.js"

      class LoginError extends LitElement
      static get properties()
      return
      show: type: Boolean, reflect: true



      static get styles()
      return css`
      div
      color: red;

      .hide-me
      visibility: hidden

      `;


      constructor()
      super();
      this.show = false


      render()
      return html`
      <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
      <!-- jQuery first, then Popper.js, then Bootstrap JS -->
      <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
      <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>


      <div class="invalid-credentials mb-3 animated $ this.show ? "shake" : "hide-me"">
      Invalid credentials, please try again
      </div>
      `



      customElements.define('login-error', LoginError)


      I would appreciate any advice on how to clean this up, and how to share this code with multiple components.







      bootstrap-4 web-component lit-element






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 14:33









      DarynDaryn

      1,1433 gold badges14 silver badges33 bronze badges




      1,1433 gold badges14 silver badges33 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          A few things:



          1. ShadowDOM only encapsulates DOM and CSS and not JavaScript. So placing your JavaScript into a component may not be the best thing to do.

          2. Several CSS libraries only work in ShadowDOM if they are, first, loaded on the page and then, second, loaded into the shadowDOM. Especially if you are loading external fonts.

          3. If you run into problems using LIT you might want to quickly try just making a vanilla JS Web Component to make sure the library isn't getting in the way. Then, once that is working, convert it back to LIT.

          4. Remember that you do not need to write a Web Component to test ShadowDOM. You can use regular JS to add a shadowRoot to any element and test using CSS and fonts in that shadowDOM.

          Good luck






          share|improve this answer


























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55400222%2fhow-do-you-use-bootstrap-with-lit-element%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0
















            A few things:



            1. ShadowDOM only encapsulates DOM and CSS and not JavaScript. So placing your JavaScript into a component may not be the best thing to do.

            2. Several CSS libraries only work in ShadowDOM if they are, first, loaded on the page and then, second, loaded into the shadowDOM. Especially if you are loading external fonts.

            3. If you run into problems using LIT you might want to quickly try just making a vanilla JS Web Component to make sure the library isn't getting in the way. Then, once that is working, convert it back to LIT.

            4. Remember that you do not need to write a Web Component to test ShadowDOM. You can use regular JS to add a shadowRoot to any element and test using CSS and fonts in that shadowDOM.

            Good luck






            share|improve this answer































              0
















              A few things:



              1. ShadowDOM only encapsulates DOM and CSS and not JavaScript. So placing your JavaScript into a component may not be the best thing to do.

              2. Several CSS libraries only work in ShadowDOM if they are, first, loaded on the page and then, second, loaded into the shadowDOM. Especially if you are loading external fonts.

              3. If you run into problems using LIT you might want to quickly try just making a vanilla JS Web Component to make sure the library isn't getting in the way. Then, once that is working, convert it back to LIT.

              4. Remember that you do not need to write a Web Component to test ShadowDOM. You can use regular JS to add a shadowRoot to any element and test using CSS and fonts in that shadowDOM.

              Good luck






              share|improve this answer





























                0














                0










                0









                A few things:



                1. ShadowDOM only encapsulates DOM and CSS and not JavaScript. So placing your JavaScript into a component may not be the best thing to do.

                2. Several CSS libraries only work in ShadowDOM if they are, first, loaded on the page and then, second, loaded into the shadowDOM. Especially if you are loading external fonts.

                3. If you run into problems using LIT you might want to quickly try just making a vanilla JS Web Component to make sure the library isn't getting in the way. Then, once that is working, convert it back to LIT.

                4. Remember that you do not need to write a Web Component to test ShadowDOM. You can use regular JS to add a shadowRoot to any element and test using CSS and fonts in that shadowDOM.

                Good luck






                share|improve this answer















                A few things:



                1. ShadowDOM only encapsulates DOM and CSS and not JavaScript. So placing your JavaScript into a component may not be the best thing to do.

                2. Several CSS libraries only work in ShadowDOM if they are, first, loaded on the page and then, second, loaded into the shadowDOM. Especially if you are loading external fonts.

                3. If you run into problems using LIT you might want to quickly try just making a vanilla JS Web Component to make sure the library isn't getting in the way. Then, once that is working, convert it back to LIT.

                4. Remember that you do not need to write a Web Component to test ShadowDOM. You can use regular JS to add a shadowRoot to any element and test using CSS and fonts in that shadowDOM.

                Good luck







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 30 at 20:40

























                answered Mar 30 at 2:04









                IntervaliaIntervalia

                6,3811 gold badge13 silver badges38 bronze badges




                6,3811 gold badge13 silver badges38 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55400222%2fhow-do-you-use-bootstrap-with-lit-element%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해