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

Provide mixins for list-bare and list-inline #419

Open
csshugs opened this issue Apr 9, 2020 · 1 comment
Open

Provide mixins for list-bare and list-inline #419

csshugs opened this issue Apr 9, 2020 · 1 comment
Milestone

Comments

@csshugs
Copy link
Member

csshugs commented Apr 9, 2020

More often than using the actual .o-list-bare and .o-list-inline objects, I create mixins for those abstractions, so I can use these on my custom components. E.g.:

// _tools.list-inline.scss
@mixin list-inline() {
  display: flex;
  margin-left: 0;
  list-style: none;
}



// _components.site-nav.scss
.c-site-nav {
  @include list-inline;
  ...
}

  .c-site-nav__item {
    margin-right: 12px;
    ...
  }

This way, I can keep my markup “clean”, i.e. not mixing object and component classes.

Proposal

By extracting the CSS of the list-bare and list-inline to mixins, we can give users the possibility to use just the mixins in their custom components. Additionally, we still provide the objects for those users who are more attracted towards adding the object classes to their markup.

This is backwards compatible and doesn’t introduce a breaking change, hence can be implemented into the current v6 major version.

@csshugs csshugs added this to the 6.1.0 milestone Apr 9, 2020
@herzinger
Copy link
Contributor

While I won't say "don't do it", I'll point out that this kills the concept of an object per the ITCSS model. It removes the code from the objects layer and repeat it n times in the components one instead, making it non-abstract in the compiled code. You can discuss if it does or doesn't matter for you and make it optional, but what makes the list related objects special in that regard? If you go with this, the same apply to any object. One way or another, I see no benefit and personally wouldn't use it.

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

No branches or pull requests

2 participants