How to get the display density in a lightning components controller?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





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







up vote
4
down vote

favorite












Is it possible to see if a user is in Comfy or Compact display density in a lightning controller? This is a new feature since Winter '19 and I cant find any documentation about this.












share|improve this question



























    up vote
    4
    down vote

    favorite












    Is it possible to see if a user is in Comfy or Compact display density in a lightning controller? This is a new feature since Winter '19 and I cant find any documentation about this.












    share|improve this question























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      Is it possible to see if a user is in Comfy or Compact display density in a lightning controller? This is a new feature since Winter '19 and I cant find any documentation about this.












      share|improve this question













      Is it possible to see if a user is in Comfy or Compact display density in a lightning controller? This is a new feature since Winter '19 and I cant find any documentation about this.









      lightning-components lightning-design-system javascript-controller






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      Robin Weymans

      434




      434




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You can get Display density information using Salesforce User Interface API. This Link will help you. I don't think you can directly access Salesforce UI-API from Lightning controller, but you can use Apex class to achieve this.






          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f234780%2fhow-to-get-the-display-density-in-a-lightning-components-controller%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            You can get Display density information using Salesforce User Interface API. This Link will help you. I don't think you can directly access Salesforce UI-API from Lightning controller, but you can use Apex class to achieve this.






            share|improve this answer
























              up vote
              2
              down vote



              accepted










              You can get Display density information using Salesforce User Interface API. This Link will help you. I don't think you can directly access Salesforce UI-API from Lightning controller, but you can use Apex class to achieve this.






              share|improve this answer






















                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                You can get Display density information using Salesforce User Interface API. This Link will help you. I don't think you can directly access Salesforce UI-API from Lightning controller, but you can use Apex class to achieve this.






                share|improve this answer












                You can get Display density information using Salesforce User Interface API. This Link will help you. I don't think you can directly access Salesforce UI-API from Lightning controller, but you can use Apex class to achieve this.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 39 mins ago









                Arun

                34628




                34628



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f234780%2fhow-to-get-the-display-density-in-a-lightning-components-controller%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    Installing NextGIS Connect into QGIS 3?

                    One-line joke