edvin
03/26/2018, 6:11 AMTicTacToe in Aluminium▾
mikehearn
03/26/2018, 7:50 AMnekoinemo
03/26/2018, 11:58 AMchild
selection similar to and
one?nekoinemo
03/26/2018, 12:00 PMbutton {
// button css
child(label){
// label css
}
}
instead of
button {
// button css
}
button.child(label){
// label css
}
?kristofdho
03/26/2018, 12:03 PMkristofdho
03/26/2018, 12:03 PMbutton {
// button css
and label {
// label css
}
}
kristofdho
03/26/2018, 12:04 PMnekoinemo
03/26/2018, 12:05 PMnekoinemo
03/26/2018, 12:07 PMand(button.child(label)) { ... }
for it to work...kristofdho
03/26/2018, 12:07 PMkristofdho
03/26/2018, 12:07 PMkristofdho
03/26/2018, 12:07 PMand
nekoinemo
03/26/2018, 12:08 PMcontains
instead of child
, in other words:
.button .label
instead of .button > .label
kristofdho
03/26/2018, 12:10 PMand
does still workkristofdho
03/26/2018, 12:10 PMkristofdho
03/26/2018, 12:10 PMbutton {
// button css
and(label) {
// label css
}
}
kristofdho
03/26/2018, 12:10 PMkristofdho
03/26/2018, 12:11 PM.child
should also just work?kristofdho
03/26/2018, 12:12 PMnekoinemo
03/26/2018, 12:16 PM.child
wouldn't work as there's no child()
defined for the CssSelectionBlock
scope, only and()
nimakro
03/26/2018, 12:28 PMbutton {
// button css
label {
// label css
}
}
nekoinemo
03/26/2018, 12:34 PMTorbilicious
03/26/2018, 12:41 PMnimakro
03/26/2018, 12:53 PM.button > .label
you already found the solution, just use and()
nimakro
03/26/2018, 1:02 PMand
@Ruckus is probably the right person to ask, if there was a reason not to add it...nekoinemo
03/26/2018, 1:03 PMand
is infix fun, i just don't think infix works when receiver is this
of this scopetieskedh
03/26/2018, 1:06 PMRuckus
03/26/2018, 2:50 PMthis
you can use them fine. All three of the following are equivalent:
// assuming
infix fun Thing.and(other: Thing) = ...
// these three are all valid and equal
thing1 and thing2
thing1.and(thing2)
with(thing1) { and(thing2) }
nekoinemo
03/26/2018, 2:59 PMRuckus
03/26/2018, 3:32 PMand
for that context. You should just need to add the other functions (child
, contains
, next
, and sibling
) with the and
definition on CSS.kt:946-951
. I agree it may not be the most forward thinking solution, but we've known for some time we'll need to rewrite most of the current CSS code to add the features we're planning, so it should be plenty good for now.