webpro / component-styleguide-example Goto Github PK
View Code? Open in Web Editor NEWExample for component-styleguide
Example for component-styleguide
Some context: I’ve looked briefly at Pattern Lab, and have used other templating languages before (Twig, Liquid) but don’t have much familiarity with Handlebars or Mustache. Given enough examples however, I can quickly pick up how something works. And if documentation refers to the terminology used in different templating languages, I then know what to search for to get further information.
This boilerplate example for Component Styleguide has been really helpful in getting me set up quickly, building out HTML components and styling them using Sass (I’m a big fan of using the script
feature in package.json too). Now, I’m at the stage where I want to arrange molecules and organisms into templates and pages, but I’m a bit lost as to what’s the recommended approach using this tool.
I tried using the documentation for Pattern Lab, not because I know it works the same, but because the tool is inspired by it. I created a template, and then created a page, with a corresponding .json
file, with that data required for that page instance, but that didn’t work. I’m guessing the only place data lives in this tool is in the data folder, which is fine. But then, how do I create pages with showing different content, based of certain templates? It’s unclear.
As a guide to using Component Styleguide, it would be helpful if this boilerplate demonstrated the full workflow, that is, pages with different data sources, possibly using the same template, which itself is a collection of organisms (which are a collection of molecules which uses an atom etc.).
Also, how do you create atoms and molecules with default values, which can be overridden with data later? For example, a button can say ‘Button text’ by default, but changed to say ‘Submit’ if certain JSON data dictates. This is where my lack of handlebars knowledge comes in, so it’s on me to learn! But an example of how to achieve this would be helpful, too.
Really enjoying the minimalist nature of the tool; just a bit more guidance/examples would be a real benefit.
Thanks,
Paul
I got the following error after running npm install
:
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/darwin-x64-node-4.4/binding.node
Updating node-sass
to the latest version in package.json
fixed the problem for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.