Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Cleaning up Default.cssCleaning up Default.css
Previous
 
Next
New Post
6/23/2009 10:06 PM
 

I'm looking to replace default.css with a cleaned up version. Going through it, a lot of things can use changing and deleting such as font sizing and erroneous classes such as "normal". Has anyone done this before? If so, would you mind sharing your cleaned up version of deafult.css?

Some of the things are necessary to keep such as the admin styles. I think it would be safe to delete any default values for p, h1 through h6, and any general html tags. My goal is to use yui-grids, reset, and fonts in the skin I am making. 

 
New Post
6/24/2009 2:13 AM
 

Hi

You could do that but then it would be screwed up on every dnn update

, I woudl sugeest a different wway. This is also how I do it

IN your skin.css reference your own default css ( this css is copied along with all your skins )

this is how my skin.css starts up

@import url("css/reset.css");
@import url("css/dnncrap.css");

reset is a stylesheet taht resets all default html styles

dnncrap is here i put all css neeeded for dnn action menu controlpanel etc etc

In here you could also put your h1 h2 etc ( altho i usually put that in another external text.css

Then in my ascx skin i have the following code block,  in strfilenames i put the css files I dont want loaded ( portal.css default.css and any other css file that is injected there because of third party modules that

Then if user is admin or host i let the css in there and if not remove them so we dont see them in the page.

This way i can keep my skins clean and dont have to worry about those crappy Normal classes that are ijected like everywhere and just have one css with my real html classes and overrides.

Because i dont realy care about how it looks a bit differnet for host or admin user they can have all the css files that dnn intended but for my normal users that is not needed they only have to see it teh way I intended it without weird surprizes because of injected html or classes ( I NEVER use .Normal in my skin totally useless )

<script runat="server">
    Protected Sub UnloadCss(ByVal sFileName As String)
        Dim oCSS As Control = Me.Page.FindControl("CSS")
        For Each oControl As Control In oCSS.Controls
            Select Case oControl.GetType.ToString
                Case "System.Web.UI.HtmlControls.HtmlLink"
                    Try
                        Dim oLink As HtmlLink = CType(oControl, HtmlLink)
                        If Regex.IsMatch(oLink.Attributes("href"), sFileName, RegexOptions.IgnoreCase) Then
                            oLink.Visible = False
                        End If
                    Catch ex As Exception
                        Response.Write("<!--Error removing Stylesheet-->")
                    End Try
            End Select
        Next
    End Sub
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strFileNames As String = "portal.css,default.css,thickbox.css"
        Dim skinDocType As Control = Me.Page.FindControl("skinDocType")
        If Not skinDocType Is Nothing Then
            CType(skinDocType, System.Web.UI.WebControls.Literal).Text = "<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">"
        End If
        Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo
        If mUser.UserID < 1 Then
            'User Not Logged In
            For Each s As String In strFileNames.Split(",")
                UnloadCss(s.Trim)
            Next
        Else
            If mUser.IsSuperUser Or mUser.UserID = PortalSettings.AdministratorId.ToString Then
                'admin or host
            Else
                'normal user
                For Each s As String In strFileNames.Split(",")
                    UnloadCss(s.Trim)
                Next
            End If
        End If
    End Sub
</script>

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Cleaning up Default.cssCleaning up Default.css


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out