-
Notifications
You must be signed in to change notification settings - Fork 70
For Designers
Designers, this section is for you. It'll help get you prototyping in a way that will allow your work to be integrated easily with Drupal.
For the design of this project we want to design systemically and share that design as live comps. We design using the Atomic Design system.
- Atoms are the basic building blocks of matter. Applied to web interfaces, atoms are our HTML tags, such as a form label, an input or a button.
- Molecules are where things start to get more tangible as we start combining atoms together. Example, a search form comprised of a label, input and submit button.
- Organisms allow us to combine molecules into something relatively complex, such as a distinct section of the interface. Example, the header or footer of a site.
- Templates consist mostly of groups of organisms stitched together to form pages. It’s here where we start to see the design coming together and start seeing things like layout in action. Example, article node page.
- Pages are specific instances of templates. Here, placeholder content is replaced with real representative content to give an accurate depiction of what a user will ultimately see.
We accomplish this by using Pattern Lab 2 with Twig. Because both Pattern Lab and Drupal 8 use Twig for templates, this means that the design components that get built can be used directly by Drupal! 🎉
If you're having issues with requirements, see the troubleshooting section below.
Organizing components using the Atomic Design system and seeing those components come to life in Pattern Lab is extremely rewarding. It's worth taking a few moments to read the Pattern Lab documentation. Below are a few basic principles.
-
Structure: All components (all HTML, CSS, JS) are housed in the
components/_patterns
directory. -
Global mixins, code: Code that is global belongs in
components/_patterns/00-base
. By default, there are files for mixins, variables, breakpoints, layout, and more. -
Building a component: A component is commonly comprised of an HTML file (Twig in our case), a CSS file (Sass in our case) and possibly a Javascript file.
components/_patterns/01-atoms/02-text/00-headings/heading-1
is a good example of a simple h1 component. Please store all code for a component together inside the component's directory. -
Pattern-Lab Specific: Pattern Lab allows you to use YML or JSON files to provide filler data in your components. You can also provide component notation via a markdown file. See
components/_patterns/01-atoms/06-buttons
for an example of both of these inside a component, as well as an example of easily providing component variants. -
Drupal-related: You may notice that there are files not organized into components such as
_block.twig
,_node.twig
. You can likely ignore these files for your work, but you can use this underscore-first file naming convention for any components that you don't want to show up in Pattern Lab.
-
node -v
to check the version of node. If it returns a version number it is installed. - If you don't have node installed, see if you have nvm installed by running
command -v nvm
. (Most likely you don't have nvm installed.) If it returnsnvm
it is installed. - If nvm is not installed, run the nvm install script, open a new Terminal window (closing the old one), then
command -v nvm
again to confirm that it is installed. - If
command -v nvm
fails, typevi ~/.bash_profile
and see that the file that is opened in the Terminal has the following in it,export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
. To exit, type:q
and return. (If you run into trouble, search for VIM help.) - Run
nvm install node
to install the latest version of node.
-
composer about
will return a description of composer. If it doesn't, then you'll need to install it. -
cd ~
this puts you in Home folder. We'll install it here first and then move it. -
curl -sS https://getcomposer.org/installer | php
this installs composer. -
sudo mv composer.phar /usr/local/bin/composer
to move composer.phar and rename it to simply "composer". You will have to enter your password for this command.
- Home
- Basics
- Examples
- Environment-specific or Special Instructions
- Acknowledgements
- To-do
- Contribute to this Wiki!