pattern-lab | based project to supply Sass components | Style Language library
kandi X-RAY | pattern-lab Summary
kandi X-RAY | pattern-lab Summary
A Node-based project to supply Sass components and a styleguide generator.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pattern-lab
pattern-lab Key Features
pattern-lab Examples and Code Snippets
Community Discussions
Trending Discussions on pattern-lab
QUESTION
I'm having some trouble with Pattern Lab 3 plus Twig.
Following the instructions at https://patternlab.io/docs/installation.html
:
I install with:
npm create pattern-lab
.I choose
Twig (PHP)
as the templating language.I choose
Twig (PHP) demo patterns (full demo website and patterns)
as the the initial patterns
I do see the note The PHP version of Pattern Lab is being deprecated in favor of a new unified Pattern Lab core. The PHP docs for this topic can be viewed here.
. Clicking on the link just takes me to installtion page for PHP edition of PL v.2. Not helpful. So I press on to https://patternlab.io/docs/generating-pattern-lab.html
.
Next I'm supposed to run php core/console --watch
. There is no core sub-directory. Things are not looking promising.
I remove my PL installation and try again with handlebars templating. With one exception, all is good. The exception: I wanted twig templates.
Ideas?
...ANSWER
Answered 2020-May-01 at 14:00Indeed, the PatternLab website you saw around the time you posted this still reflected the 2.x/3.x days. Work is being done to get the legacy out and the current state in.
Last month, I contributed to this package: @pattern-lab/engine-twig
. This engine is a pure Javascript based twig engine which prevents the need for PHP. It uses the Twing library under the hood (since v5.8.0). There are still things to iron out, but I welcome you to try it. Please file bugs here:
QUESTION
I have a Pattern Lab edition-node-gulp set up and would like to use NPM to manage UI dependencies, like jQuery, D3 and others. Pattern Lab is set up so that development happens in a 'Source' folder, which is complied and moved to a 'Public' folder. The root of the Public folder becomes the root of the application when served.
Currently, I include assets like jQuery and others manually. I think it would be great to manage dependencies like jQuery right in the package.json file used to run all of Pattern Lab Node, but the node_modules folder exists outside of Public, so I can not reference it in the live application.
So far, it seems that I have two options:
- Continue as is, and forget package management for these assets.
- Create a second package.json inside Public with jQuery and others, which seems sloppy.
Is creating a second package.json so bad? Am I failing to consider some other option?
...ANSWER
Answered 2017-Dec-21 at 22:48Creating a second package.json is not that bad (when you know what and how you are doing of course). However in your particular case it is not the best scenario because there are way better options.
What is the problem? Adding the assets to the build output. So, what you can do:
- install the assets via
npm install
and save them in the original package.json - adapt
gulpfile.js
to copy the files in the output directory.
If the second step step is too hacky / problematic it could be also replaced with simple package.json scripts
change (add build
script):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pattern-lab
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page