[Dojo-interest] widgets, template and css
Peter Higgins
dante at dojotoolkit.org
Tue Jun 1 10:30:32 EDT 2010
So if two widgets require the same "base css" you get multiple <link />
elements?
Also, the build system concatenates css files into one for fast loading
in production ... How would a "css layer" alert code that a
dojo.requireCss() has already been resolved within? (dojo._hasResource
is what the build uses for js, but we can't execute anything in css) ...
We've looked down this path before, but as I said, never came up with a
solution that "works"
~phiggins
Eril Kaleo wrote:
> I don't care about "onload" of a <link/>. So it means that if I have some dependency to a css rule in my js, I make sure that this rule is loaded somewhere before that widget is instantiated. Ugly, I know but what else?
>
>
>
>
>
> ----- Original Message ----
> From: Peter Higgins <dante at dojotoolkit.org>
> To: dojo-interest at mail.dojotoolkit.org
> Sent: Tue, June 1, 2010 3:51:30 PM
> Subject: Re: [Dojo-interest] widgets, template and css
>
> We've talked about requireCss() for a while now, but have never come up
> with a solution to track the dependency. When does the "onload" fire for
> a <link/>? How do you manage order? First come first serve?
>
> Regards,
> Peter
>
> Eril Kaleo wrote:
>
>> Hello,
>>
>> We'are developing a widget based application, thus the whole think is quite dynamic.
>> Most of our widgets have templateString's and css. So we created a base widget class for our domain foo
>> inheriting from [dijit._Widget, dijit._Templated, foo._CssEngine]
>>
>> We like to see widgets as independent and compound elements. So we thought that apart from overall styles
>> every widget should have its own css. _CssEngine is basically managing <link rel="stylesheet" ..> tags.
>> It works like a naive implementation dojo.require(...)
>>
>> So I wonder what is the rational or reasons behind leaving css out of dijit? Why css isn't conceived like a structural part of a widget?
>> The closest thing is the style property of _Widget class, but than again, to be sure that it's set before the widget is loaded is quite cumbersome...
>>
>> Regards.
>>
>>
>>
>>
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://docs.dojocampus.org
>> Dojo-interest at mail.dojotoolkit.org
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>>
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://docs.dojocampus.org
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
>
>
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://docs.dojocampus.org
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
More information about the Dojo-interest
mailing list