Skip to content

Conversation

@dromo77
Copy link
Contributor

@dromo77 dromo77 commented Jul 15, 2021

Overview

This PR adds a modifier so we can divide lists into multiple columns.

Screenshots

Screen Shot 2021-07-15 at 11 56 42 AM

Testing

  1. Deploy Preview

@changeset-bot
Copy link

changeset-bot bot commented Jul 15, 2021

🦋 Changeset detected

Latest commit: 4d7527b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudfour/patterns Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@tylersticka tylersticka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! One question inline

Comment on lines 51 to 56
@include fluid.grid-gap(
breakpoint.$s,
breakpoint.$xl,
size.$spacing-gap-fluid-min,
size.$spacing-gap-fluid-max
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that we're setting grid-gap rather than column-gap here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I missed this, thanks!

columns: {
control: {
type: 'range',
min: 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should min be 1? Otherwise there isn't a way from the story controls to enable and then disable columns.

@@ -0,0 +1,15 @@
{% if columns and columns > 1 and columnsBreakpoint and columnsBreakpoint != 'none' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional that columnsBreakpoint is required? Is there no use case where someone would want columns on by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would someone use multiple breakpoints?

o-list--2-columns o-list--3-columns@xl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tylersticka Would something like this work better?

{% if columns and columns > 1 %}
  {% set _list_class = 'o-list--' ~ columns ~ '-column' %}
{% elseif columns and columns > 1 and columnsBreakpoint %}
  {% set _list_class = 'o-list--' ~ columns ~ '-column' ~ columnsBreakpoint %}
{% else %}
  {% set _list_class = '' %}
{% endif %}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would alleviate some of the problems, but if you wanted to do something like this:

o-list--2-columns@s  o-list--3-columns@m

I think it would prevent that?

(This is one of the reasons I've just been using a class property for defining the class attribute in some of my other patterns. It gets complicated pretty quickly!)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This is one of the reasons I've just been using a class property for defining the class attribute in some of my other patterns. It gets complicated pretty quickly!)

Good idea! 👍 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this?

args={{
 class: 'o-list--2-column@s o-list--3-column@m'
}}

@dromo77 dromo77 merged commit 2fbf9d8 into v-next Jul 16, 2021
@dromo77 dromo77 deleted the dot-leader-columns branch July 16, 2021 15:39
@github-actions github-actions bot mentioned this pull request Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Column pattern

4 participants