These are chat archives for japgolly/scalacss

Mar 2015
Otto Chrons
Mar 26 2015 15:13
@japgolly so my idea about modular styles would involve a dynamic "CSS sink" which would put the generated CSS in the place where the user wants it (like under <head><style>) instead of generating the CSS in one operation
this allows individual style modules to define styles when needed and they would be appended to the CSS automatically
therefore libs could have their own ScalaCSS definitions without knowing how they end up in the actual HTML document, nor would they need access to the "top level" style object
Justin du Coeur, AKA Mark Waks
Mar 26 2015 15:15
That makes sense to me. I haven't started playing with it yet, but I've had back-of-mind that this sort of modularity seems desireable...
Otto Chrons
Mar 26 2015 15:18
also the Registry could optimize generated styles by removing duplicates as they are generated
another issue is to have truly inline styles with no CSS backing that would also support fully dynamic parameters
these are required for things like dynamic layout (setting width/height/padding whateva) when window size changes etc
or when using CSS 3D transforms like does
these need to go into the style attribute
but then again, these kinds of styles would not be generated in a stylesheet to begin with
Otto Chrons
Mar 26 2015 15:26
third, support or at least a clear convention on stylesheet parameters, for stuff like defining a global color theme that would be used by different component libs
this is often done with LESS variables, but it's quite cumbersome IMO
for example with materializecss I have to specify colors all over the place, because there is no concept of a color theme
same thing for fonts
Otto Chrons
Mar 26 2015 15:34
so the style libs should expose customization parameters that could be configured by the application
Otto Chrons
Mar 26 2015 18:18
another architectural question is regeneration of CSS when global params change, let's say user wants to change the theme to "high contrast for visually impaired" which would affect colors and fonts
for this to work the Registry should somehow know all the style providers and ask them to regenerate when the need arises
Otto Chrons
Mar 26 2015 18:36
which, in turn, means that they cannot be static objects but need to be able to regenerate when requested