As a compromise, how about we allow the following syntax: <Window> <StyleClass name="foo">{...}</StyleClass> <BoxPane> <PushButton styleClass="foo"/> </BoxPane> </Window>
Or some other variant, where the essential point is that it style classes get declared as one of the first child elements on a container, so that it gets added to the parent early. -- Noel Grandin Greg Brown wrote: > FYI, named styles are turning out to be a lot more challenging than I > expected. The solution I proposed the other day doesn't work - elements in > BXML aren't added to the parent element until the end tag is processed. So, > given the following structure: > > <Window styleClasses="{foo:{...}}"> > <BoxPane> > <PushButton styleClass="foo"/> > </BoxPane> > </Window> > > when the styleClass attribute of the PushButton is processed, the BoxPane > hasn't yet been added to the Window, so the "foo" style class name resolves > to null. :-( > > I'll keep thinking about it, though. Suggestions are welcome. > > Thanks, > G >