Design and CSS styles
Version 3.x > Design and CSS styles > Styles missing in Visual Studio 2008 View modes: 
User avatar
Member
Member
Richard - 9/2/2008 10:14:32 AM
   
Styles missing in Visual Studio 2008
Even with the relevant style checked-out and present in the VS08 project solution, these class or CssClass values are still showing as 'not defined' warnings (in 3.1a home.aspx for example):

homeTopImage3cols
zoneTop
zoneLeft
zoneCenter
zoneRight

CSS 2.1 validation errors exist for 'word-wrap' in both CorporateSite.css and CorporateSiteGrayBlue.css.

What am I missing?...;-)

Thanks,
Richard

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 9/2/2008 4:26:29 PM
   
RE:Styles missing in Visual Studio 2008
Hi Richard,

I'll start from the end. I've found related discussion about word-wrap css 2.1 validation for example at
http://drupal.org/node/291384
and even more sites over internet. Briefly, the word-wrap is meant to be CSS 3 property, however, the validator has some problems.

As for the classes, isn't that caused by the "!important" flag behind some property values being interpreted as faulty in your validator?

Best Regards,
Zdenek Cetkovsky

User avatar
Member
Member
Richard - 9/7/2008 7:43:15 AM
   
RE:Styles missing in Visual Studio 2008
The presence of the "!important" flag might explain the warnings in home.aspx except that I'm able to use and recognize the !important flag in other CSS 2.1 stylesheets within VS2008 on other, non-Kentico sites, without such errors so that's not it.

Just to take the !important flag totally out of the picture, when I open root.master I get 13 warnings (12 CSS and 1 XHTML), none of which are related to the !important flag. For example, mainDiv, zoneLogo, zoneTop, signOut, currentUser, shoppingCartPreview, searchbox, zoneMenu, horizontalmenu, zoneMainContent, zoneBottom, and zoneFooter are all listed as "The class or CssClass value is not defined (i.e. every single instance of a <div class= is undefined).

The XHTML warning is that the 'title' element occurs too few times.

It appears that Visual Studio simply has no connection between even checked-out stylesheets and templates, master pages, or the rest of the site in general.

VS2008 Professional with SP1 applied is the environment.

Suggestions?

Thanks,
Richard

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 9/8/2008 10:55:51 AM
   
RE:Styles missing in Visual Studio 2008
Hi Richard,

Thank you for the details given.

This is unfortunately caused by VS2008 behavior. Since Kentico stores CSS stylesheets in database, it’s impossible for VS to find references to classes used in your code. That’s why there are CSS warnings. Regarding XHML warning – this occurs also because title tag is generated dynamically (you can set it via CMS Desk).

Anyway you can reduce these warnings by going to ‘Tools -> Options -> Text editor -> HTML -> Validation’ in VS. You could change DTD of document to lower, e.g.: XHML 1.0 Transitional. Or if you want to prevent warning messages of that type, you could switch off ‘Show errors’ property on the same location.

Best regards
Ondrej Vasil


User avatar
Member
Member
Richard - 9/8/2008 11:24:05 AM
   
RE:Styles missing in Visual Studio 2008
Either way I'm stuck not being able to use VS2008 to apply or manage styles since it has no notion of the related stylesheets...not a very tight VS2008 integration architecture (compared with SiteFinity for example).

Thanks,
Richard

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 9/9/2008 5:42:54 AM
   
RE:Styles missing in Visual Studio 2008
Hi again,

There's another possibility how to prevent warning CSS messages in VS2008.

You could try following:

1. Cut content from your stylesheet in 'CMS Site Manager -> Development -> CSS stylesheets' and let there only empty "body {}" definition.

2. Then in VS2008 please right-click '~\App_Themes\<your site>', add new item and choose 'Style Sheet'. Please paste here all content you've cut before.

3. Please go to 'CMS Desk -> Content -> <root> -> Master page tab' and you can see that system recognizes new stylesheet that you've created. Please click 'save'.

This should enforce that Kentico CMS will use CSS stylesheet from 'App_Themes' folder. You can edit it here.

Best regards
Ondrej Vasil