It is both. In JavaScript you cannot see the value of a variable outside of the function it is declared in. If you declare styleSheetText within the callback function for YUI().use(), you cannot see its value outside of that callback function.
It is also a YUI issue. The callback function to YUI().use() is going to execute asynchronously, that is, the time of execution is unpredictable but it will always be after that console.log() statement gets executed. Thus, even if you made styleSheetText global to get around the variable visibility issue, it would still show undefined.
Usually, you put all your code within the callback function for YUI().use(). That would fix both problems.