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

Add option to add data attribute to target element not to html tag. #102

Open
wisniewski94 opened this issue Oct 9, 2019 · 1 comment
Open

Comments

@wisniewski94
Copy link

wisniewski94 commented Oct 9, 2019

Hi!

(skip for TL;DR)
I am working on open source project called Keyboard UI (Link: Keyboard_UI/develop) which is customizable UI kit with transparency effect using SASS. I wanted to fully controll outline so I made my own but problem was with focus on buttons and clicking (I don't want to have outlines when user is using mouse). Then I saw this awesome module (thanks!) but this one had another problem -> data attribute is saving to html tag not directly to target. Since my project has some limits when it comes to customization and I need to make it easy for user to use, I need to have data attribute in target element to make sass snippets like so:

@mixin somemixin($n)
      &:focus:enabled:not([data-whatintent='mouse']):not([data-whatinput='mouse'])
            @include outline($n, "default")

//user usage
button.ui
      @include somemixin(#000)

Right now there is no way to do that because data is stored in html tag (from what I know). So I made a fork and some changes (I know it's hard coded) and it works the way I would like it to be. Link to forked version:

Fork wisniewski94/what-input

Because I would like my project to be fully Open-Source there are few options to consider:

  1. I could publish forked version to npm. It's not elegant but it works.
  2. With some help (I didn't get much too deep into code) I could make it a feature.

Thanks!

@wisniewski94
Copy link
Author

  1. Fixed with patch-package from npm.

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

No branches or pull requests

1 participant