GithubHelp home page GithubHelp logo

cloudfour / drizzle Goto Github PK

View Code? Open in Web Editor NEW
667.0 39.0 32.0 434 KB

A streamlined tool for developing, documenting and presenting UI pattern libraries.

Home Page: https://cloudfour.com/thinks/introducing-drizzle/

License: MIT License

JavaScript 17.41% CSS 38.65% HTML 43.94%
styleguide patterns

drizzle's Introduction

drizzle's People

Contributors

calebeby avatar erikjung avatar gerardo-rodriguez avatar nicolemors avatar nopzen avatar tylersticka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drizzle's Issues

Smarter nav tree building?

If history repeats itself, our patterns will tend to fall into a structure similar to this:

src/patterns/    (includes collections)
├─ components/   (includes collections)
│  ├─ button/    (includes patterns)
│  ├─ dropdown/  (includes patterns)
│  └─ grid/      (includes patterns)
└─ typography/   (includes patterns)

Currently, there does not appear to be a concise way of building that entire nav tree in the desired order without marking up top-level and deeper pattern groups separately, like so:

<ul class="drizzle-Nav-menu">
  {{!-- Top-level patterns --}}
  {{#each drizzle.patterns}}
    {{#if collection}}
      <li>
        <a class="drizzle-Nav-item" href="/patterns/{{@key}}.html">
          {{collection.name}}
        </a>
      </li>
    {{/if}}
  {{/each}}
</ul>
<h5 class="drizzle-Nav-item">Components</h5>
<ul class="drizzle-Nav-menu">
  {{!-- Component patterns --}}
  {{#each drizzle.patterns.components}}
    <li>
      <a class="drizzle-Nav-item drizzle-Nav-item--heading"
       href="/patterns/components/{{@key}}.html">
        {{collection.name}}
      </a>
    </li>
  {{/each}}
</ul>
{{!-- etc. --}}

I'd love if there were a better way of doing this, either a way of looping over all the collections and telling when a parent had started, or some special nav-specific group to loop through that separated stuff out. I dunno, it just seems weird the way it currently is. Maybe it's just me! ¯_(ツ)_/¯

Default pattern `name` is being ignored in the collection template

Apologies if this is specific to cloudfour.com-patterns (happy to close this issue if so), but I've been encountering behavior I don't really expect.

If I create a pattern called foo-bar.hbs, my expectation is that it's default name (if I fail to provide one) will be "Foo Bar." I'd say about 50 - 75% of the time, replacing - with and capitalizing each word in the result will give the desiredname.

But currently, if I fail to provide a name, it won't output any heading at all. 😕

There is no way to hide an entire collection if all patterns need to be hidden

For example,

src/patterns/foo has two patterns, both of which should be hidden.

Adding a collection.yaml to this directory with the contents of hidden: true should make the Foo collection hidden from iterators, etc.

Currently, attempting to do this results in an error with the builder:

[10:45:18] Starting 'drizzle'...
[10:45:18] Starting 'css:drizzle'...
[10:45:18] Starting 'css:toolkit'...
[10:45:18] Starting 'js'...
[10:45:19] Starting 'assets'...
[10:45:21] Finished 'css:drizzle' after 2.6 s
[10:45:22] 'drizzle' errored after 3.8 s
[10:45:22] Error
    at Error.DrizzleError (/Users/aileen/Desktop/jedec/node_modules/drizzle-builder/dist/utils/error.js:9:16)
    at Function.DrizzleError.error (/Users/aileen/Desktop/jedec/node_modules/drizzle-builder/dist/utils/error.js:26:13)
    at /Users/aileen/Desktop/jedec/node_modules/drizzle-builder/dist/parse/patterns.js:242:27
[10:45:24] Finished 'js' after 5.14 s
[10:45:24] gulp-imagemin: Minified 0 images
[10:45:24] Finished 'css:toolkit' after 5.41 s
[10:45:24] Finished 'assets' after 5.36 s

/CC @aileenjeffries @mrgerardorodriguez

HTML beautifier needs more adjustment

Things noticed recently:

  • The attribute wrapping might not be worth it to enable
  • Extra blank lines are retained
  • Mysterious extra whitespace following </a> within a lines of text

screen shot 2016-04-29 at 12 52 55 pm

Invalid name: "@cloudfour/hbs-helpers"

I am really excited to check out your project! However, when running npm start or npm install it bombs out when trying to install the @cloudfour/gulp-tasks and @cloudfour/hbs-helpers modules because of an invalid module name.

npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i"
npm ERR! node v5.6.0
npm ERR! npm v3.6.0

npm ERR! Invalid name: "@cloudfour/hbs-helpers"

I am using a Mac Mini (late 2014) on OS X 10.11.4 I also tried installing using node v4.0.0 with the same problem.

Am I the only one running into this issue?

Electron app for Terminal-phobes

One issue we've experienced a few times is a hesitance from collaborators to use our environment because the Terminal can be scary when you aren't used to it.

I mentioned this idea in #31, but having seen that Electron reached v1.0.0 today, I thought I should document the idea of creating some sort of Drizzle app that might simplify the process for clients and skittish collaborators.

No idea if this is even possible (or worth pursuing), but I'm thinking the app might consist of:

  • A menu bar icon to show whether Drizzle is running or not.
  • Ability to choose a project folder to run.
  • Ability to start, stop or restart the task from said icon or interface.

Active nav item isn't highlighted at `/`

If the page "Overview" is at index.html, navigating to /index.html will highlight it in the nav (applying the .is-active class), whereas navigating to / will not.

Related: #3

Demo site

We need a publicly-accessible demo! 😃

This could be a Netlify site, or we could use something like gulp-gh-pages to use GitHub pages.

Consider adopting timeline (or similar view) for default overview/intro page

I was reminded of this by this Smashing post that @megnotarte shared. Specifically:

One way to display the output better is by using a project hub — one central place with all the important assets all collected in one place, sorted chronologically, and always up to date. As a result, the client can come to the site at any time and see the progress right away.

Right now, our "Overview" page is pretty useless. It gives a partially redundant introduction to the platform, repeats the navigational elements, and sometimes dumps the color palette there. I think there's an opportunity to treat the introductory piece more as a "hub" than it is currently.

Food for thought! 🍔

Boilerplate listable FPO data

The typographic specimens are awesome. But I also need this sorta stuff on most (if not all) projects:

  • List of user info (example)
  • List of article-like content (title, author, date, excerpt, body)

It'd be pretty great to have some of that included and ready to go, even/especially if it just gets edited to suit project needs. It might also help demonstrate that the data/ folder can incorporate as many files as one might like.

Make Drizzle CSS config simpler

Right now, many of the Drizzle CSS components rely on custom properties like --color-blue. It would be nice if these all relied on a small selection of base variables to make customization of the style even simpler.

npm run build

After have run the simple npm start and installed all packages, and then added a new component file, i try to build the project, when running npm run build i get and npm error:

> [email protected] build /Users/larsfalcon/Downloads/drizzle-master
> npm prestart && gulp


Usage: npm <command>

where <command> is one of:
    access, add-user, adduser, apihelp, author, bin, bugs, c,
    cache, completion, config, ddp, dedupe, deprecate, dist-tag,
    dist-tags, docs, edit, explore, faq, find, find-dupes, get,
    help, help-search, home, i, info, init, install, issues, la,
    link, list, ll, ln, login, logout, ls, outdated, owner,
    pack, ping, prefix, prune, publish, r, rb, rebuild, remove,
    repo, restart, rm, root, run-script, s, se, search, set,
    show, shrinkwrap, star, stars, start, stop, t, tag, team,
    test, tst, un, uninstall, unlink, unpublish, unstar, up,
    update, upgrade, v, verison, version, view, whoami

npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm faq          commonly asked questions
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    /Users/larsfalcon/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

[email protected] /Users/larsfalcon/.nvm/versions/node/v4.0.0/lib/node_modules/npm

npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/larsfalcon/.nvm/versions/node/v4.0.0/bin/node" "/Users/larsfalcon/.nvm/versions/node/v4.0.0/bin/npm" "run" "build"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `npm prestart && gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'npm prestart && gulp'.
npm ERR! This is most likely a problem with the drizzle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm prestart && gulp
npm ERR! You can get their info via:
npm ERR!     npm owner ls drizzle
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/larsfalcon/Downloads/drizzle-master/npm-debug.log

But running the npm prestart runs the npm install fine and calling the npm start calles the gulp --dev it starts up the server with the correct stuff inside :)

Im creating a easy fix for this guys! Other than that this Drizzle thing looks cool

`blank.hbs` should be easier to extend

This is a follow-up to my misguided cloudfour/drizzle-builder#81 issue.

The current blank.hbs layout looks like this:

<!DOCTYPE html>
<html class="{{htmlclass}}">
  <head>
    {{#block "head"}}
      {{!-- (etc.) --}}
    {{/block}}
  </head>
  {{#block "wrapper"}}
    <body>
      {{#block "body"}}

      {{/block}}
    </body>
  {{/block}}
</html>

The trouble is that if you want to extend this template and append things to body like so:

{{#extend "blank"}}
  {{#content "body" mode="append"}}
    <p>Hello world!</p>
  {{/content}}
{{/extend}}

It will not work. This appears to be because the body block is nested within the wrapper block.

My feeling is that we should restructure blank.hbs so there's more consistency between the HTML class, body class, head and what are essentially "foot" assets:

<!DOCTYPE html>
<html class="{{htmlclass}}">
  <head>
    {{#block "head"}}
      {{!-- (this part stays the same) --}}
    {{/block}}
  </head>
  <body class="{{bodyclass}}">
    {{#block "body"}}

    {{/block}}
    {{#block "foot"}}

    {{/block}}
  </body>
</html>

This would allow us to specify bodyclass the same way as htmlclass, and we could pass along <script> elements and other resources with {{#content "foot"}}{{/content}}. But there may be other ways to pull this off!


@mrgerardorodriguez @erikjung

Could toolkit scripts be easier to create?

Currently, creating new toolkit scripts requires you to create a new file, then add a somewhat redundant item to config.js:

'drizzle/scripts/drizzle': './src/assets/drizzle/scripts/drizzle.js',
'toolkit/scripts/toolkit':  './src/assets/toolkit/scripts/toolkit.js',
'drizzle/scripts/some-page': './src/assets/toolkit/scripts/some-page.js'

It seems like this could be simplified, at least so that the toolkit/scripts directory doesn't need a new entry for every single root JS package. But I might be missing something.

Doesn't work on Windows

If you attempt to run this repo on Windows, you'll get complaints about missing partials (specifically drizzle.swatch for me). Possibly something unix-centric about the way partial paths are generated?

Frontmatter field for adding classes to preview

Sometimes we may want to add a class like u-spaceChildren or u-rhythm to the example output w/o adding additional markup to the source preview. Other times, it's better to keep things simple. It would be nice if we could specify classes via pattern frontmatter and have them appended to the pattern container.

Unable to put new folders into pattern folder

There seems to be no way of adding a new folder or using other folder names aside from 'Components' and 'Elements'. I tried changing the folder names to 'Atoms', 'Modules', 'Organsims', re-run gulp --dev but sidebar still shows 'Components' and 'Elements' at the side.

Back-end Integrations

Awesome work Cloud Four team 👏

Thought I'd toss out a question I receive a lot when using Fabricator - I'm often asked if there is a way to easily bridge the gap between Fabricator and a back-end system. I designed Fabricator to be agnostic of whatever system it might be integrated into, but often its used as an initial phase of development for a single site, not a suite of sites that use a shared design system.

Many teams want to reduce the wasted effort that comes with maintaining two separate projects. When a pattern is updated in Fabricator, they want the corresponding pattern in their .NET, Java, PHP, etc project to be updated as well. It becomes burdensome to make a change in Fabricator, then make the same exact change in the integrated code.

Have you heard the same? Any ideas on how to solve the issue?

Should we reinstate boilerplate color swatches?

The only two projects that use Drizzle so far have both restored the color swatches. That suggests to me that we should consider adding them back.

I'd like if we abandoned the design we inherited from Fabricator. Some ideas for improvement might be:

  • Put gutters between swatches to avoid any unrealistic (and unnecessary) color combinations.
  • Avoid situations where a smaller amount of secondary colors would appear more prominent than primary colors.
  • Include additional color information where applicable, such as class names for color-related helpers.

Food for thought! 🍔

Page item and label header markup has some quirks

  • There's too much margin above the titles at large sizes (should probably be margin below thumbs instead).
  • We should override padding on labels in case a project doesn't (they are a <ul> currently).
  • We should allow pattern titles to wrap (not sure why we aren't).

Documentation

We need more. 😁

  • Update this issue description with more specific to-dos

Page titles should have defaults

If {{title}} is undefined, we should use the current collection title, or fall back to the project title. It might also be nice to have the project name appended to the title anyway.

Examples

"Drizzle" represents the project name...

<!-- If {{title}} is defined: -->
<title>Overview - Drizzle</title>

<!-- Else if collection title is defined: -->
<title>Button - Drizzle</title>

<!-- Else: -->
<title>Drizzle</title>

Surprise! Tyler still has issues with `order`

I know, I know, I've already talked a ton about this in cloudfour/drizzle-builder#31. But it's still not working the way I'd like it to, and I thought I'd document that (even if it has to wait for a future version to be resolved).

The Problem

Here's a hypothetical collection of patterns:

- disabled.hbs
- group.hbs
- overview.hbs
- style-variations.hbs

By default, these will show up in the same order as above... whatever the file system determines "alphabetical" means for these files.

Let's say I want "Overview" to be the first pattern. Currently, that's really easy. I just add the property to my Frontmatter:

---
order: 1

---
{{! etc. }}

And the order changes:

1 overview.hbs
- disabled.hbs
- group.hbs
- style-variations.hbs

Simple.

But what if I want a pattern to sort to the end?

For example, maybe the group pattern should go after all of the patterns pertaining to individual instances.

Currently, that would require that I specify an order for every file:

1 overview.hbs
2 disabled.hbs
3 style-variations.hbs
4 group.hbs

Alternatively you could give everything after overview the same order value. But you'd still have to specify for every single pattern, as any pattern lacking an order property will show up after everything else.

My Recommendation

This use-case is why I recommended (and prototyped) that we mimic the CSS order property in structure. Specifically its initial value of 0.

Having an initial value means negative numbers show up earlier than the default, positive numbers show up later.

This means you'd only need to specify the order property for the patterns you wanted to move, regardless of which direction they moved...

-1 overview.hbs
 - disabled.hbs
 - style-variations.hbs
 1 group.hbs

It also seems intuitive given our target audience to make our order property behave in a manner similar to an order property they're familiar with.

Where to put favicon, other root assets?

The simplest method of including favicon.ico is in the root directory, which also avoids any 404 requests in the browser. Many static generators have an htdocs or static directory for assets that should be copied over verbatim. It would be nice to not have to specify <link> elements for this info.

Make assets task registered and configured by default

Currently, the assets task from https://github.com/cloudfour/core-hbs-helpers is present as a dependency, but is not registered or configured in gulpfile.js or config.js respectively.

Since it's common to need images and other static assets copied into dist, this task should probably be enabled and ready to go.

Questions

  • Which folder location makes the most sense for sourcing? We've used src/assets/toolkit/ before, but is that what we want as a default?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.