Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pattern variants #87

Open
thibaudcolas opened this issue Feb 24, 2020 · 4 comments
Open

Add support for pattern variants #87

thibaudcolas opened this issue Feb 24, 2020 · 4 comments
Labels
django Related to Django templates capabilities enhancement New feature or request storybook Usage of Storybook will affect this
Milestone

Comments

@thibaudcolas
Copy link
Member

Extracted from #28.

Add pattern variants (nice to have - not essential for open sourcing)

@thibaudcolas thibaudcolas added enhancement New feature or request storybook Usage of Storybook will affect this labels Feb 24, 2020
@thibaudcolas thibaudcolas added this to the Nice to have milestone Feb 24, 2020
This was referenced Feb 24, 2020
@thibaudcolas thibaudcolas added the django Related to Django templates capabilities label Feb 26, 2020
@thibaudcolas
Copy link
Member Author

Will also add some notes from @nmorduch in #11 about this, which seems related:

An established setup for situations where our pattern templates don't show everything

  • overviews (e.g. here are all the types of buttons)
  • mockups (e.g. here is just a plain page with a functional modal, but it's not what you would use to include the modal)
  • what something looks like with every permutation of fake data

this could possibly be accomplished with some combination of:

  • a folder for overviews and mockups (or one for each)
  • a setup where you write in the yaml that there are multiple versions of the data, and then when viewing the pattern library you get an overview page or you get the pattern but with the option to select which data set you want. e.g.:
contexts:
  display: switcher
  - name: No introduction
    context:
      page:
        title: Page Title
  - name: Short intro
    context:
      page:
        title: Page Title
        introduction: Introduction to page
  - name: Long intro
    context:
      page:
        title: Page Title
        introduction: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque laoreet ante ac sapien eleifend tincidunt id ac diam. 
contexts:
  display: overview
  - name: .button
    template: button.html
    context:
      label: Default button
  - name: .button--alt
    template: button.html
    context:
      label: Alt button
      classes: button--alt
  - name: .button--large
    template: button-large.html
    context:
      label: Large button

@thibaudcolas
Copy link
Member Author

Mentioned in the docs as of #131, with workaround.

@simkimsia
Copy link
Contributor

@thibaudcolas wrote

Mentioned in the docs as of #131, with workaround.

Sorry, but what workaround is this? I went to #131 but I am none the wiser.

@thibaudcolas
Copy link
Member Author

@simkimsia here are the docs that cover this: https://torchbox.github.io/django-pattern-library/guides/multiple-variants/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
django Related to Django templates capabilities enhancement New feature or request storybook Usage of Storybook will affect this
Projects
No open projects
Status: Low priority
Development

No branches or pull requests

2 participants