Iāve been using both Roots and Bedrock for a while, and both of these projects have forced me to up my game in terms of how I go about designing, building and deploying websites for clients.
In the spirit of continuing to improve my workflow, Iāve recently started to experiment with http://patternlab.io and the associated atomic design system. Now I am wondering if anybody on here has any experiences of using Pattern Lab with Bootstrap and Roots.
If you have not tried Pattern Lab yet, check it out. I guarantee you will be impressed.
Yes, been using patternlab.io to great effect. Just set up a grunt file and include bootstrap, works a treat. If you have any questions leave them in this thread and Iāll try to help you out.
@treb0r
Wow I canāt believe that was 25 days ago. I will try and get it working with Gulp, Iāve used gulp from the start, Iāve never tried my hands on grunt!
Just a question, how are you using Patternlab? Do you use it simply for the styleguide? Or have you set it up so that you are including in actual ābitsā. I was playing around with a Jade port of patternlab I was making and I would use certain bits by adding them as mixins or includes.
Weāre using Patternlab to build all the page templates. It saves loads of time and effort. No more full page mockups in photoshop or illustrator.
Weāve got it working with gulp now. Once youāve got the pages designed in PL you can copy the assets (less, images, etc) into your sage theme. Copy the html in the generated PL files into your sage .php theme files, throw in some template tags and off you go.
Looking forward to trying out some of these other css frameworks soon.
Iāve almost got patternlab fully working, with stylus jeet and jade! All I need to understand is your folder structure. At the moment I dumped all the folders from patternlab into my theme directory.
The problem with this is that I donāt know how to access it from wordpress, because patternlabās public output is simply a static site. The only way I can load it is by dragging the main html file into the browser, just so I can see what I am doing. This is probably more of a limitation of my understanding of wordpress and .htaccess.
I also changed: var manifest = require('asset-builder')('.source/assets/manifest.json');
into: var manifest = require('asset-builder')('./assets/manifest.json');
because thatās where Sage keeps it by default and I wasnāt sure why you moved it. Perhaps to parse info/assets from patternlab?
You shouldnāt dump the Patternlab files into Sage.
I think trying to to use stylus, jeet and jade is also complicating matters. Iām waiting until Yeoman arrives before I try any of that stuff. I would just get Patternlab working with Bootstrap for now so you can learn how it works.
If you decide to have another go with Patternlab and Bootstrap you should clone a fresh copy of Sage and move it into your theme directory.
Then you can cherry pick the assets you need from Patternlab (Images, Less, JS).
Put those assets into the right places in the Sage assets folder. You should now be able to compile your assets for Sage with Gulp.
Once that is working you need to copy the html from Patternlab into the theme php templates as required.
Thank you! That makes more sense, I thought you had just automated the entire thing. I appreciate your help and guidance thus far and will do as you recommended.
Regarding Bootstrap, I may give it another shot too, I just find it so bloated and messy to work with. Perhaps I need to learn cleaner ways of using bootstrap
Hi Treb0r - this whole discourse is very interesting but Iām just having some issues with understanding the setup whereby Iād have bedrock, sage running with patter lab somewhere in that set up whereby my front end developers could work solely in pattern lab source folder (Iāve already cloned bootstrap sass in here and have pattern lab working with bootstrap - originally using compass) compiling into the public css (and perhaps being able to access using domain/app/patternlab/public/) and also into the sage assets css - so the set up here would make both css files the same and allow any changes made to pattern lab be mirrored in sage. I was thinking that I could use the sage gulpfile.js to achieve this mechanic and looking at the above discourse I thought thatās what you were doing but something doesnāt seem right. So just to recap ā¦
We keep PattternLab and Sage separately. We have got our own gulpfile together for Patternlab that is based on the Sage gulpfile.
Templates live in Patternlab as that allows us to build up a library of reusable UI components and PL is handy for displaying the layouts to the client.
Once signed off, itās just a matter of copying the assets (Sass, Bower.json, etc) into a fresh checkout of Sage. We then just copy and paste the html5 templates as needed to build the working theme. Itās not integrated, but it works well.
Hey, would you mind sharing how you set-up bootstrap with patternlab (node). Did you use bootstrap-sass? I am new to pattern lab and not sure how to setup bootstrap-sass correctly with it. Thanks
I work with @treb0r on WordPress sites built with Sage using PatternLab for the UI design. I use a hybrid of PatternLab with the front-end workflow of Sage 8.5. The Sage 9 webpack workflow still blows my mind at the moment
Here is a brief explanation of how I use Bootstrap with PL.
First I pull bootstrap-sass via bower into a bower_components folder in the PL source folder.
My PL source folder uses the same /assets folder and file structure as Sage 8.5
Then I have similar gulpfile to the one used by Sage 8.5. This runs a sequence to compile the assets (.scss .js etc.) into a /dist folder using the rev manifest in the same way as Sage 8.5.
Make sure that manifest.json uses the correct paths to tell gulp where to compile the assets into PL
"paths": {
āsourceā: āsource/assets/ā,
ādistā: āpublic/dist/ā
},
Once everything has compiled, the last event in the sequence is to run the pattern lab builder command using gulp-shell. I use the standard php twig edition of PatternLab so if youāre using the node edition the pattern lab build task will be different.
One other thingā¦ as Iāve told gulp to compile the assets into /public/dist/ I need to link to the assets in /public/dist/ in Pattern Labās head template and data.json
Instead of keeping patternlab separate and copying over compiled HTML files into their respective templates in the wordpress theme, I would like to see the process more integrated where PatternLabās files were actually part of the theme (keeping everything DRYer).
I saw this article and it helped my understanding get a bit closer, but Iām not brave enough to try it while my current projectās deadline looms.
Looking forward to getting this cracked one day, I think it would be an awesome workflow!
PS are people using Axis and Jeet in 2018? I have never heard of them.