There are countless articles about customizing the content and layout of the /checkout/cart page, however, I didn’t find one about how to add custom CSS or JS references to this page only, preferably in a “cleaner” manner, such as:
The code you posted works for most pages, but because method “addCss” isn’t available to the checkout.xml file by default that won’t work for the cart. In fact it’ll actually generate an error.
I haven’t looked into this too much, but in theory you could extend a few core classes in a custom module to get Magento to first recognize that method in checkout.xml and then to add the css. I think I found my next weekend project =)
Out of curiosity, why do you want a specific CSS file for the cart? What would the benefit be over keeping the code in the same CSS file as the rest of the site?
If you only want to add a custom css for checkout cart page, you can go to file:
..\app\design\frontend\base\default\layout\checkout.xml (or the layout file that is corresponding to your theme)
After that, add your css file to checkout_cart_index tag: