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 2 rules for same property #11

Closed
futurist opened this issue Jun 2, 2018 · 7 comments
Closed

add 2 rules for same property #11

futurist opened this issue Jun 2, 2018 · 7 comments

Comments

@futurist
Copy link

futurist commented Jun 2, 2018

I've try to add 2 rules for same property like below:

console.log(b.cursor('ns-resize').cursor('-webkit-grab').style)

But result is only last style, is this an issue?

@porsager
Copy link
Owner

porsager commented Jun 3, 2018 via email

@futurist
Copy link
Author

futurist commented Jun 3, 2018

When adding style to drag & drop element, I like the -webkit-grab cursor style, but for others don't support it, I'd like to fallback to ns-resize, but cannot get it in one rule, that's why I post this issue.

@porsager
Copy link
Owner

porsager commented Jun 4, 2018

Ah I see. That makes perfect sense. I'll look into it.

Until then you can define them in separate instances like this :

b.cursor('ns-resize') + b.cursor('-webkit-grab')

That will generate 2 classes but still achieve the desired end result.

@futurist
Copy link
Author

futurist commented Jun 9, 2018

About this issue, I'm also facing the flexbox problem:

.page-wrap {
  display: -webkit-box;  /* OLD - iOS 6-, Safari 3.1-6, BB7 */
  display: -ms-flexbox;  /* TWEENER - IE 10 */
  display: -webkit-flex; /* NEW - Safari 6.1+. iOS 7.1+, BB10 */
  display: flex;         /* NEW, Spec - Firefox, Chrome, Opera */
}

.main-nav,
.main-sidebar {
  -webkit-box-flex: 1;   /* OLD - iOS 6-, Safari 3.1-6 */
  width: 20%;            /* For old syntax, otherwise collapses. */
  -webkit-flex: 1;       /* Safari 6.1+. iOS 7.1+, BB10 */
  -ms-flex: 1;           /* IE 10 */
  flex: 1;               /* NEW, Spec - Firefox, Chrome, Opera */
}

I'm struggled to include above into bss also.

@porsager
Copy link
Owner

porsager commented Jun 9, 2018

Thanks a lot for the examples @futurist I'll look into it today ;)

@porsager
Copy link
Owner

Hi @futurist.. So I did look into it, but got caught up in a small mind game about the last flex-box example you posted. So optimally I'd want bss to handle this behind the scenes. That means I'd want bss to simply take display: flex; and flex: 1, and then do the cross-browser support automatically. This is probably something that will take some time to do properly, and your initial use case of doing various cursors would still be present.

So — I'll be introducing support for multiple same named properties (as one expects would be possible), but I'll hold out on documenting it for now until I've thought through a proper solution for seamless cross-browser support..

I've just pushed the changes now, but I'll hold on with a new release until I've done some more testing.

Would you mind trying out how it works for you with the latest commit?

@futurist
Copy link
Author

Yes, the lastest commit allow same property repeation, thanks!

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

2 participants