NES.css icon indicating copy to clipboard operation
NES.css copied to clipboard

feat: New button group element `nes-btn-group`

Open jdvivar opened this issue 6 years ago • 6 comments

Description

I've added a new nes-btn-group class:

<div class="nes-btn-group">
  <button type="button" class="nes-btn is-primary">this</button>
  <button type="button" class="nes-btn">is a</button>
  <button type="button" class="nes-btn">button</button>
  <button type="button" class="nes-btn">group</button>
</div>

Here an update on the /index.html demo: screenshot 2019-02-19 at 18 36 18

Compatibility

It adds a new class, so it won't break anything made before

Caveats

  • There might be a better way to do this, as the inner shadows of the buttons are not consistent. However this is better than not having it, so it's improved :)
  • I haven't added a storybook element as I'm not familiar with it, it's missing there, sorry!
  • Max number of elements in button group is whatever we put in SASS, 6 at the moment. We can just write a bigger number though.

jdvivar avatar Feb 19 '19 18:02 jdvivar

Looks good 🎉 I'll review it later 🙇

BcRikko avatar Feb 19 '19 23:02 BcRikko

Hi @BcRikko, your comments are exactly the caveats in my PR.

I've improved the PR based on that and now:

  • Shadow is consistent
  • The maximum number of items in a button group is now a default variable (set to 10)
  • I've adapted the disabled state so that it's consistent inside a button group

This is how it looks now: screenshot 2019-02-23 at 21 37 10

jdvivar avatar Feb 23 '19 21:02 jdvivar

sry, I'm busy... so It will be late for me to review. 🙇

I have not reviewed all of them,,, I think that the following code is improved by using negative margin. 🛠 max-btn-group-items will not be needed. 🤔

    .nes-btn:nth-child(#{$i + 1}) {
      left: -($i * 24px);

↓↓↓

margin-left: -4rem;  // `-4rem` is roughly length.

I'll review other parts at a later date. 🙇‍♀️🙇‍♀️🙇‍♀️

BcRikko avatar Feb 26 '19 01:02 BcRikko

Hello, the icons of social networks look bad if the page is 100%, if I change it to 110% they look good, why does that happen?

100%

image

110%

image

tjvalpo avatar Mar 13 '20 19:03 tjvalpo

Hello @tjvalpo . I'm not really sure why this happens. Could you open an issue about this problem, so that we or another contributor can look into it? Thank you.

guastallaigor avatar Mar 14 '20 11:03 guastallaigor

what is the status of this pull request? Is it ever going to make it into master or develop?

ldd avatar Apr 12 '20 03:04 ldd