Article 81 and 82 - Twitter Bootstrap
Last Post 09/21/2013 5:26 PM by Joseph Craig. 11 Replies.
Author Messages Not Resolved
soulia
Nuker
Nuker
Posts:12


--
05/21/2013 8:42 AM
    Great articles! Thanks. Well worth the subscription. My question - what is a best practice to override the bootstrap css styles? For example, I would like to change the default bootstrap css table style with:

    .table-striped tbody > tr:nth-child(odd) > td,
    .table-striped tbody > tr:nth-child(odd) > th {
    background-color: #999;
    }

    I placed this style in the skin.css file, but of course, the bootstrap.css overrides this as it is declared in the default.ascx file (as can be seen in Chrome tools).

    Thanks,
    Mike
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    05/21/2013 9:12 AM
    Mike,

    There is a discussion in VIdeo 4 of the skin tutorial about css order. That might help to make sure that the bootstrap css files are loaded before the skin.css. Then, your overrides should work.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    soulia
    Nuker
    Nuker
    Posts:12


    --
    05/21/2013 10:36 AM
    Hi Joe,

    Thanks for the information. I reviewed the video. Video 1 of part 2, correct? To make this work, would I have to write the default.ascx script similar to your nav class example? I did try this, but was unable to pull together the syntax (yet). In my example, I added a table to the HTML module in the #LeftPane container. My goal is to override the bootstrap css on the .table-striped and .table-hover classes.

    I did come up with a solution that seemed to work. I'm not sure if it's a best practice or not. I added my .table-striped and .table-hover classes to my skin.css file and appended
    !important
    after the style. e.g.

    .table-striped tbody > tr:nth-child(odd) > td,
    .table-striped tbody > tr:nth-child(odd) > th {
      background-color: #999 !important;
    }
    
    .table-hover tbody tr:hover > td,
    .table-hover tbody tr:hover > th {
      background-color: #700 !important;
    } 
    
    soulia
    Nuker
    Nuker
    Posts:12


    --
    05/23/2013 10:09 AM
    Hi Joe,

    Just to provide fodder for discussion, the !important tag seems to have a bad rap (Stackoverflow, etc.). Mostly for perceived lack of understanding of css precedence and maintenance issues. That being said, DNN has a fairly established css chain. And if I'm not mistaken, Bootstrap is used mostly for sizing and spacing elements, images and fonts. It seems quite reasonable to apply the !important tags to color styles in the skin.css file to override the default Bootstrap colors. Maintenance seems fairly straight forward here.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    06/01/2013 4:29 PM
    Yes, "important" is a blunt tool, and should be used sparingly, if not at all!

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    rlriggs
    Nuke Newbie
    Nuke Newbie
    Posts:2


    --
    06/11/2013 2:51 PM
    Agree, these are great tutorials and I'm working on implementing. The two videos in Part 2 reference more coming. Is there a timeline when these will be released. Like reading a great book and the last chapters are missing...
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    06/11/2013 2:58 PM
    Rick,

    I'm sure that Andy appreciates your comments.

    About the most that I can say is "soon." Not speaking for Andy, I know that the production of his high quality tutorials take time. And, like a "great book" they do take time.

    In general, the schedule calls for new material at least monthly.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    James Brown
    Nuke Newbie
    Nuke Newbie
    Posts:7


    --
    07/08/2013 10:39 AM
    Seems to have blown his schedule. It has been almost 3 months.
    peter
    Nuke Active Member
    Nuke Active Member
    Posts:24


    --
    07/08/2013 1:00 PM
    Well I don't know about "blown". Some of the articles include up to 11 videos and a number of resource packs so given the undoubted quality and value some will take longer to compile test and publish than the ideal "monthly" schedule. I for one am looking forward to the next part of this article, and I'm expecting it to be full of useful technique, tips and insights which will be worth the wait.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    07/09/2013 8:01 AM
    andynhas released a number of DNN7 tutorials over the last couple,of months. You can find them at http://www.dnncreative.com/Home/Sea...inst=2425.

    Does anyone have any special,requests for the Bootstrap,series?

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Shawn Cohan
    Nuke Newbie
    Nuke Newbie
    Posts:4


    --
    09/21/2013 4:12 PM
    At the end of Article 82, video 2, styling techniques for the bootstrap menu were mentioned for the next video. I would really like to see this. I'm hopeful other people would find this useful too.

    Thank you!
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    09/21/2013 5:26 PM
    Andrew is currently reworking the tutorials and adding more material. The new set of tutorials will be compatible with the new release of Bootstrap. I expect those to be released "soon."

    Joe Craig, Patapsco Research Group
    Complete DNN Support


    ---