Dec 20 2016 06:02 AM
Can I or How do I make the workspace bigger on Workbench.aspx (the spfx workbench)
Dec 20 2016 10:39 AM
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.
Dec 03 2020 01:47 AM
@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.
Dec 03 2020 02:36 AM
@Cardinal_Night check out this web part, hope it can help you.
https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/js-workbench-customizer
You can just add it to your workbench page and carry on working. It will force the workbench to the same size of a normal SharePoint page, and you can also edit the page and change the web part settings to make it full width. It's not the perfect solution, but hope it can help you
Dec 03 2020 02:39 AM
@Joel Rodrigues Is it a case of simply copying code into the root webparts .ts file?
If it's too complicated I'll probably struggle!
Dec 03 2020 02:44 AM
No, just download the code from the repository that I linked.
Run: npm install, gulp bundle --ship, gulp package-solution --ship.
Upload the package to the app catalog and add the web part to your workbench page :) The web part will be on the page together with your solution, but it's completely isolated
Let me know if you have any questions. If the instructions on the readme file of the solution are not clear, I would appreciate feedback so I can update them
Dec 03 2020 03:54 AM - edited Dec 03 2020 03:55 AM
@Joel Rodrigues Getting error when bundling:
Error: JSON validation failed:
C:\Users\me\developer\sp-dev-fx-webparts\samples\js-workbench-customizer\config\package-solution.json
Error: #/solution
Additional properties not allowed: developer at .... (loads more locations in node modules here).
developer is the folder I keep all projects in btw
Dec 07 2020 01:23 PM
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;
}
}
Dec 14 2020 06:34 AM - edited Dec 14 2020 06:37 AM
@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.
Dec 19 2021 09:21 PM