Styles and scripts are what bring a website to life. They are a critical part of today's website architecture and Umbraco has made them a large part of the backoffice UI. Like with all the other coding functionality, both CSS and JavaScript files are edited in a syntax highlighter that also includes row numbers. As a developer, you can maintain and code all of your styles and scripts within the Umbraco UI, but best practice dictates that you work on such assets outside of the web UI to maintain processes such as code versioning and multi-developer environments.

image As mentioned earlier, please see Appendix B for working with files outside of Umbraco and for best practice advice on how to set up your development environment in Visual Studio 2010.

Defining Your Styles

The CMS allows you to expose your styles to the Rich Text Editor data type in order for authors to truly get a WYSIWYG (What You See Is What You Get) environment in which to edit content. Best practice suggests that as a developer, you plan your styles in at least two different physical files—one for the layouts of your site and one that dictates aspects such as paragraph styles, floating images, headings, bulleted lists, and so on. The idea is that applying the “content” styles to the editor data type without the baggage of all the layout styles as well is then possible.

This can have an effect on ...

Get Umbraco User's Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.