Forum Discussion

Russell Gove's avatar
Russell Gove
Iron Contributor
Dec 20, 2016

Increase size of workarea on SPFX Workbench.aspx

Can I or  How do I make the workspace bigger on Workbench.aspx (the spfx workbench)

  • mujassir's avatar
    mujassir
    Copper Contributor

    I have added the following styles in my module.scss file and it worked perfectly for me.

    :global {
          #workbenchPageContent, .CanvasComponent.LCS .CanvasZone {
            max-width: 100% !important;
          }
        
        }
    • Cardinal_Night's avatar
      Cardinal_Night
      Brass Contributor

      mujassir Where do you add it in the scss file? Encompassing all other elements? or just at the top?

       

      It's not working for me, it doesn't accept :global for a start, if I change it to .global it does, but still, doesn't work for me.

       

      Update: keeping the code as Mujassir suggests, DOES work on spfx. This is a much quicker solution. Well done.

       

  • Waqar Muneer's avatar
    Waqar Muneer
    Copper Contributor

    In "src" directory of porject there is ".scss" file. You can add styles here, whether you want to add new or override existing styles. In "helloWorld" sample project ".scss"  file path is probably "helloworld-webpart\src\webparts\helloWorldHelloWorld.module.scss".

    I hope this will help.

     

     

    • Cardinal_Night's avatar
      Cardinal_Night
      Brass Contributor

      Waqar Muneer This doesn't make the workbench placeholder bigger it only makes the container bigger using scss. If you make the container bigger than the workbench it the sides of the container will disappear, which is no good. If you know of a way to make the workbench place holder bigger then please do share.

Resources