Closed dkwingsmt closed 7 years ago
Hi @dkwingsmt,
your first syntax example should actually work.
Something like this:
var styles = cssInJS({
foo: {
marginTop: 10
},
'foo p': {
color: 'red'
}
});
will get transformed to this:
var styles = {
foo: 'test-foo',
foo p: 'test-foo p'
};
an that CSS:
.test-foo {
margin-top: 10px;
}
.test-foo p {
color: red;
}
Oh wait! That foo p
key in the transformed styles
object actually is invalid syntax and throws a "SyntaxError: Unexpected identifier". Is that also the exception you are getting?
I think so. I do remember seeing an "Unexpected identifier" error in some cases, not clear if it was this one. Will check tomorrow if needed.
Will check tomorrow if needed.
Yeah, please do.
Yes, that's what I got.
@dkwingsmt The syntax error got fixed in v1.4.1. So your first example above should now properly work. Please check.
I also plan to support for your second proposal (subselectors inside the class name spec) soon.
Wow that sounds like a great news. Thank you.
By the way, in your test case, p
being not localized is a little unexpected to me. Well, it doesn't matter if you will implement my second proposal.
By the way, in your test case,
p
being not localized is a little unexpected to me.
What do you mean with "p being not localized"?
Never mind. I've tested it today and it really works well. Thank you, and looking forward to it. :)
Hello, I wonder if subselectors are supported at the moment, since either of following syntax seems to throw syntax errors,
Despite the second syntax being a SASS style and might not be the focus of this project, the first syntax actually belongs to CSS syntax and is quite useful, or actually irreplaceably necessary, in practice.