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

Select component #154

Closed
wants to merge 4 commits into from
Closed

Conversation

4k1k0
Copy link
Contributor

@4k1k0 4k1k0 commented Dec 10, 2018

I added a select component.

I had to remove the border-style mixin from the input scope in input.scss so I can use it.

This solves the issue #152 .

Copy link
Member

@BcRikko BcRikko left a comment

Choose a reason for hiding this comment

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

Thanks 🙇
Please wait a moment as I have other things to try. 🙏

2018-12-10 13 22 04

background: white;
border: none;
outline: none;
@include border-style(#000000, #ffffff);
Copy link
Member

Choose a reason for hiding this comment

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

please use color variables 🙏

  • #000, black -> $base-color
  • #fff, white -> $background-color

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay 😄 I will fix it later 🙇

@BcRikko BcRikko added the enhancement New feature or request label Dec 10, 2018
@4k1k0 4k1k0 closed this Dec 11, 2018
@4k1k0 4k1k0 deleted the select-component branch December 11, 2018 04:56
@4k1k0 4k1k0 restored the select-component branch December 14, 2018 03:23
@4k1k0
Copy link
Contributor Author

4k1k0 commented Dec 14, 2018

@trezy I restored the branch. Sorry. 🙇‍♂️

@4k1k0 4k1k0 reopened this Dec 14, 2018
@BcRikko
Copy link
Member

BcRikko commented Dec 14, 2018

Sorry for the late comment. 😢

I reexamined the styles with reference to your implementation. 🔧
Please split the files of inputs.scss and selects.scss. 🙏

I don't need to provide a dark theme for input elements. 🙇
I added the color of the state instead of dark theme. 🎨

.nes-select {
  @mixin border-style($border, $outline) {
    color: $border;
    box-shadow: 0 4px, 0 -4px, 4px 0, -4px 0;

    > select {
      outline-color: $outline;
    }

    &::after {
      color: $background-color;
      background-color: $border;
    }
  }

  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 4px;

  @include border-style($base-color, map-get($default-colors, "hover"));

  &.is-success {
    @include border-style(map-get($success-colors, "normal"), map-get($success-colors, "hover"));
  }
  &.is-warning {
    @include border-style(map-get($warning-colors, "normal"), map-get($warning-colors, "hover"));
  }
  &.is-error {
    @include border-style(map-get($error-colors, "normal"), map-get($error-colors, "hover"));
  }

  > select {
    width: 100%;
    padding: 0.5rem 3.2rem 0.5rem 1rem;
    cursor: $cursor-click-url, pointer;
    border: none;
    -webkit-appearance: none;
    appearance: none;
  }

  &::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.5rem;
    line-height: 2.5rem;
    color: $background-color;
    text-align: center;
    pointer-events: none;
    content: ">";
    transform: rotateZ(90deg);
  }
}
<div class="nes-select">
  <select>
    <option>Hello</option>
    <option>World</option>
  </select>
</div>
<div class="nes-select is-success">
  <select>
    <option>Hello</option>
    <option>World</option>
  </select>
</div>
<div class="nes-select is-warning">
  <select>
    <option>Hello</option>
    <option>World</option>
  </select>
</div>
<div class="nes-select is-error">
  <select>
    <option>Hello</option>
    <option>World</option>
  </select>
</div>

select

@4k1k0
Copy link
Contributor Author

4k1k0 commented Dec 14, 2018

That's pretty dope! 😎 I have a problem. I don't have the $X-colors variables. i.e. $default-colors. I suppose they're need to be declared inside scss/base/variables.scss. And when I try to build or commit the build fails and I can't continue. What should I do? I can't push and I did a fetch to develop branch already. 😕 🆘 🙇‍♂️

@BcRikko
Copy link
Member

BcRikko commented Dec 14, 2018

umm…… 🤔
Color variables are already merged into the latest develop branch 🤔

$default-colors: (
normal: $background-color,
hover: #e7e7e7,
shadow: #adafbc
);
$disabled-colors: (
normal: #d3d3d3,
shadow: #adafbc
);
$primary-colors: (
normal: #209cee,
hover: #108de0,
shadow: #006bb3
);
$success-colors: (
normal: #92cc41,
hover: #76c442,
shadow: #4aa52e
);
$warning-colors: (
normal: #f7d51d,
hover: #f2c409,
shadow: #e59400
);
$error-colors: (
normal: #e76e55,
hover: #ce372b,
shadow: #8c2022
);

References to the develop branch may be old 🙈
Could you try settings upstream as follow link. 🙏
https://github.com/nostalgic-css/NES.css/pull/164/files#diff-4ed520cfcdddf22dea24c7672e0e6047R62

@trezy trezy added the waiting - contributor Waiting for the contributor to address some situations label Dec 14, 2018
@BcRikko
Copy link
Member

BcRikko commented Dec 23, 2018

This PR was addressed by #217.
Sorry 🙇

@BcRikko BcRikko closed this Dec 23, 2018
@BcRikko BcRikko removed the waiting - contributor Waiting for the contributor to address some situations label Dec 23, 2018
@tlynetteb
Copy link

tlynetteb commented Dec 30, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants