YUI Calendar: How Does It Load the CSS Sam Skin?

I am using YUI 2 calendar in YUI 3. How does it load Sam CSS skin?

I haven't manually enabled it (although it seems like I have to load it like that in one request I make to the combo loader for css). Oddly enough, I can't see it being loaded, nor can I see it in the JS files themselves. I have to miss this. This is how I load CSS and JS now:

<head>
    ...
    <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.1.0/build/cssreset/reset.css&amp;3.1.0/build/cssfonts/fonts.css&amp;3.1.0/build/cssbase/base.css"/>
    ...
</head>
...
<!--and at the end of the body tag:-->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.1/build/yui/yui-min.js&amp;3.1.1/build/oop/oop-min.js&amp;3.1.1/build/event-custom/event-custom-base-min.js&amp;3.1.1/build/event/event-base-min.js&amp;3.1.1/build/json/json-parse-min.js&amp;3.1.1/build/querystring/querystring-stringify-simple-min.js&amp;3.1.1/build/io/io-base-min.js&amp;3.1.1/build/dom/dom-base-min.js&amp;3.1.1/build/dom/selector-native-min.js&amp;3.1.1/build/dom/selector-css2-min.js&amp;3.1.1/build/node/node-base-min.js&amp;3.1.1/build/node/node-style-min.js&amp;3.1.1/build/stylesheet/stylesheet-min.js&amp;2in3.1/2.8.0/build/yui2-calendar/yui2-calendar-min.js&amp;2in3.1/2.8.0/build/yui2-yahoo/yui2-yahoo-min.js&amp;2in3.1/2.8.0/build/yui2-dom/yui2-dom-min.js&amp;2in3.1/2.8.0/build/yui2-event/yui2-event-min.js"></script>
<script type="text/javascript">//<![CDATA[
YUI().use('yui2-calendar', function(Y) {
    var YAHOO = Y.YUI2;
    var cal = new YAHOO.widget.Calendar("cal",{navigator:true,mindate:'1/1/2000');
    cal.render();  
    // ...

      


Edit : I want to make a few minor changes to the default skins. What's the best way to do this?

I answered this part of my question. If I move the calendar to an extra div, then setting the CSS rules that include the div as part of the selector makes the rule more specific, so the browser uses it on top of Sam's shell. Example:

<style type="text/css">
.magic .yui-skin-sam .yui-calendar td.calcell {
    height: 10em;
    width: 15em;
}
</style>
    ...
    <div class="magic">
        <div class="yui-skin-sam">
            <div id="cal"></div>
        </div>
    </div>

      

+2


a source to share


1 answer


http://yuilibrary.com/forum/viewtopic.php?f=93&t=2269&p=7608&hilit=insertbefore#p7608

This thread contains information about using the insertBefore config, which allows you to make sure the YUI CSS is inserted above your style, overrides in the CSS cascade.



-Erik

+2


a source







All Articles