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

New: Add margin start and margin end column classes (fixes #504) #505

Merged
merged 3 commits into from
May 22, 2024

Conversation

swashbuck
Copy link
Contributor

@swashbuck swashbuck commented Mar 28, 2024

Fixes #504

New

  • Adds new margin start and margin end column classes (e.g. margin-start-sm-2 and margin-end-md-1) for indenting components from the left or right.

Testing

Configure two single width components using the existing column classes and the new margin classes. For example, in the same block:

Single width Text component
Add classes col-md-5 margin-start-md-1. This makes the component 5 columns wide with a 1 column margin from the left at the medium breakpoint and higher.

Single width Graphic component
Add classes col-md-4 margin-end-md-1. This makes the component 4 columns wide with a 1 column margin from the right at the medium breakpoint and higher.

The result for the above would look something like the following (gray block background color and guidelines added for illustrative purposes):

margin-start-end

The number of columns + starting/ending margins must add up to the total number of columns (or less) which is 12 unless redefined in the theme.

Additional work

The theme wiki should be updated with these new classes.

@swashbuck swashbuck self-assigned this Mar 28, 2024
@swashbuck swashbuck changed the title New: Add push and pull classes (fixes #504) New: Add push and pull column classes (fixes #504) Mar 28, 2024
less/project/columns.less Outdated Show resolved Hide resolved
less/project/columns.less Outdated Show resolved Hide resolved
less/project/columns.less Outdated Show resolved Hide resolved
@guywillis
Copy link
Contributor

Lovely work @swashbuck 👍

Copy link
Contributor

@guywillis guywillis left a comment

Choose a reason for hiding this comment

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

👍

@oliverfoster
Copy link
Member

oliverfoster commented Apr 8, 2024

@kirsty-hames
Copy link
Contributor

Why calling them pull and push and not margin left and right?

columns, gutters, margins

I'd agree. Perhaps margin start and margin end to align with the CSS?

@swashbuck
Copy link
Contributor Author

Why calling them pull and push and not margin left and right?

@oliverfoster Since these classes can be used with RTL layouts, "left" and "right" would not work. As for "push" and "pull", these were the names that Bootstrap used for the same sort of utility class. So, my thought was that they would be familiar to developers who have used Bootstrap. However, they may be deprecated in the newest version(s).

I'd agree. Perhaps margin start and margin end to align with the CSS?

@kirsty-hames Yep, I'm fine with this if everyone else is? "Start" and "end" would make sense with both RTL and LTR. Something like this then?

margin-start-sm-2
margin-end-md-1

@swashbuck
Copy link
Contributor Author

swashbuck commented Apr 9, 2024

Yep, deprecated as of v4:
https://getbootstrap.com/docs/4.0/migration/#grid-system-1

Dropped push and pull modifier classes for the new flexbox-powered order classes. For example, instead of .col-8.push-4 and .col-4.pull-8, you’d use .col-8.order-2 and .col-4.order-1.

Of course, by no means do we need to follow Bootstrap's conventions.

Copy link
Contributor

@joe-allen-89 joe-allen-89 left a comment

Choose a reason for hiding this comment

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

👍

@swashbuck
Copy link
Contributor Author

To do:

  • Change class names to include "margin". For example: margin-start-sm-2 and margin-end-md-1
  • Change CSS classes/mixins. .make-columns-pull .make-columns-push
  • Update documentation and examples where necessary

@swashbuck swashbuck changed the title New: Add push and pull column classes (fixes #504) New: Add margin start and margin end column classes (fixes #504) Apr 26, 2024
@swashbuck
Copy link
Contributor Author

Class names have been updated. Ready for re-review.

Copy link
Contributor

Choose a reason for hiding this comment

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

👀

@swashbuck swashbuck merged commit 5ee17b7 into master May 22, 2024
@swashbuck swashbuck deleted the issue/504 branch May 22, 2024 13:38
Copy link

🎉 This PR is included in version 9.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column push / pull classes
6 participants