LWC: Can I have an expression and a string as a class combination?Loading dynamic images as background, how can I check for image first?Dynamically Adding/Removing CSS in Nested DivCan interface have inner classes or interfaces?Can we access class properties dynamically with Object class?background-size contain not working when rendering VF page as PDFTarget inner elements of standard Lightning Web Components with CSSIs there a way of dynamically binding attributes to css variables, allowing for dynamic styling rules?Animation in lightning componentContent Overflow with <lightning:checkboxGroup>LWC: How to toggle CSS class on button click?

must a ring (commutative, with 1), in which every non-zero ideal is prime, be a field?

Does bottle color affect mold growth?

What does Fisher mean by this quote?

In the movie Harry Potter and the Order or the Phoenix, why didn't Mr. Filch succeed to open the Room of Requirement if it's what he needed?

Infeasibility in mathematical optimization models

Can an actual attack instead of a feint be used as the distraction for a help action?

Erratic behavior by an internal employee against an external employee

LWC: Can I have an expression and a string as a class combination?

How to explain to a team that the project they will work for 6 months will 100% fail?

"How do you solve a problem like Maria?"

Capacitors with a "/" on schematic

WordCloud: do not eliminate duplicates

Need help understanding lens reach

Finish the Mastermind

If there were no space agencies, could a person go to space?

Secure my password from unsafe servers

How can glass marbles naturally occur in a desert?

How does the oscilloscope trigger really work?

Our group keeps dying during the Lost Mine of Phandelver campaign. What are we doing wrong?

Colleagues speaking another language and it impacts work

What is the resistivity of copper at 3 kelvin?

Why should public servants be apolitical?

Word or idiom defining something barely functional

Is there a loss of quality when converting RGB to HEX?



LWC: Can I have an expression and a string as a class combination?


Loading dynamic images as background, how can I check for image first?Dynamically Adding/Removing CSS in Nested DivCan interface have inner classes or interfaces?Can we access class properties dynamically with Object class?background-size contain not working when rendering VF page as PDFTarget inner elements of standard Lightning Web Components with CSSIs there a way of dynamically binding attributes to css variables, allowing for dynamic styling rules?Animation in lightning componentContent Overflow with <lightning:checkboxGroup>LWC: How to toggle CSS class on button click?






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








1















I have a div and I want to assign one css class statically and one dynamically.



Something like this:



<div class="my-class + dynamicClass"></div>


However that is not working and I am not sure if it's possible.










share|improve this question






























    1















    I have a div and I want to assign one css class statically and one dynamically.



    Something like this:



    <div class="my-class + dynamicClass"></div>


    However that is not working and I am not sure if it's possible.










    share|improve this question


























      1












      1








      1








      I have a div and I want to assign one css class statically and one dynamically.



      Something like this:



      <div class="my-class + dynamicClass"></div>


      However that is not working and I am not sure if it's possible.










      share|improve this question














      I have a div and I want to assign one css class statically and one dynamically.



      Something like this:



      <div class="my-class + dynamicClass"></div>


      However that is not working and I am not sure if it's possible.







      class lightning-web-components css directive






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      ArthleteArthlete

      1,24712 silver badges23 bronze badges




      1,24712 silver badges23 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          7














          No, it's not possible. You can only use getters for specifying a value, such as:



          <div class=classes>


          ...



          get classes() 
          return `my-class $this.dynamicClass`;



          You can read more about this in the documentation.






          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "459"
            ;
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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/3.0/"u003ecc by-sa 3.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%2fsalesforce.stackexchange.com%2fquestions%2f272968%2flwc-can-i-have-an-expression-and-a-string-as-a-class-combination%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









            7














            No, it's not possible. You can only use getters for specifying a value, such as:



            <div class=classes>


            ...



            get classes() 
            return `my-class $this.dynamicClass`;



            You can read more about this in the documentation.






            share|improve this answer





























              7














              No, it's not possible. You can only use getters for specifying a value, such as:



              <div class=classes>


              ...



              get classes() 
              return `my-class $this.dynamicClass`;



              You can read more about this in the documentation.






              share|improve this answer



























                7












                7








                7







                No, it's not possible. You can only use getters for specifying a value, such as:



                <div class=classes>


                ...



                get classes() 
                return `my-class $this.dynamicClass`;



                You can read more about this in the documentation.






                share|improve this answer













                No, it's not possible. You can only use getters for specifying a value, such as:



                <div class=classes>


                ...



                get classes() 
                return `my-class $this.dynamicClass`;



                You can read more about this in the documentation.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 8 hours ago









                sfdcfoxsfdcfox

                281k14 gold badges230 silver badges482 bronze badges




                281k14 gold badges230 silver badges482 bronze badges






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Salesforce Stack Exchange!


                    • 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%2fsalesforce.stackexchange.com%2fquestions%2f272968%2flwc-can-i-have-an-expression-and-a-string-as-a-class-combination%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

                    ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                    Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу