m_header.less 5.32 KB
/***************************************************
* feature  :  全局头部,提供默认 深色(绿底白字) & 浅色(白底黑字)主题;
* update   :  2015/02/03;
* use      :  .m-header;
* extend   :  .header-*;
* example  :  <header class="m-header header-light"></header>;
* desc     :  默认为深色主题, 通过 .header-light 来引用浅色主题;
* feedback :  此处填入 issue, 并请附带以下信息[os_version, browser_version, page_path, issue_description]
*          -  demo => [windows 7, IE 8, http://diligrp.com/icon.html, 在不定height下未能垂直居中];
****************************************************/

@import "var";
.head {
    height: 44px;
    box-sizing: border-box;
    text-align: center;
}
.logo {
    width: 25px;
    .bg-img;
    background-position: -125px 11px;
    margin: 0 15px;
}
.m-header {
    // position: absolute; 
    // position: fixed; //fixed header 到顶部
    z-index: 5;
    color: #FFF;
    background-color: rgba(44, 170, 63, 1); //默认是绿底白字
    position: relative;
    &.header-light {
        //浅色模式
        background: rgba(255, 255, 255, .8);
        color: #000;
        box-shadow: inset 0 0 1px #ddd;
        .text {
            color: #666;
        }
    }
    .head {
        padding: 0 50px;
        box-sizing: border-box;
        h1 {
            display: inline-block;
            vertical-align: middle;
            line-height: 44px;
            font-weight: normal;
            font-size: 18px;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
    }
    
    // .h-search {
    //     background-color: #55bb22;
    //     border-radius: 3px;
    //     height: 30px;
    //     line-height: 30px;
    //     color: #eee;
    //     text-align: left;
    //     .icon-search {
    //         display: inline-block;
    //         vertical-align: middle;
    //         width: 20px;
    //         height: 20px;
    //         .bg-img;
    //         background-position: -60px -142px;
    //     }
    // }
    .lt-bar, .rt-bar {
        //左右两端区域,用于放置 icon | text
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        min-width: 44px;
        height: 44px;
        line-height: 44px;
        height: 100%;
        // background: url(../img/icon_menu.png) center center no-repeat;
        cursor: pointer;
    }
    .lt-bar {
        float: left;
        &.text{
            padding-left: 10px;
            text-align: left;
        }
    }
    .rt-bar {
        float: right;
        left: auto;
        right: 0;
        &.text{
            padding-right: 10px;
            text-align: right;
        }
    }
    .text {
        text-align: center;
        line-height: 44px;
        font-size: 15px;
        color: #FFF;
    }
    &.header-search{
        .head{
            padding: 7px 44px 7px 44px;
        }
        .search-box{
            line-height: 30px;
            font-size: 14px;
            padding: 0 8px;
            background-color: #55bb22;
            border-radius: 3px;
            height: 30px;
            color: #eee;
            cursor: text;
            // text-align: center;
            text-align: left;
        }
        .input-wrap{
            overflow: hidden;
            padding-left: 8px;
            box-sizing: border-box;
        }
        .m-input{
            float: left;
            width: 98%;
            display: block;
            padding: 4px 0;
            color: #FFF;
            &::-webkit-input-placeholder{
                color: #EEE;
            }
        }
        .m-dropdown{
            float: left;
        }
        #search-btn{
            background: none;
            color: #fff;
            font-size: 14px;
        }
    }
    &.header-home {
        .head{
            position: relative;
            padding: 7px 10px 7px 44px;
            margin-right: 0;
        }
        
    }
}

// .header {
//     height: 44px;
//     // background: @hbg-color;
//     background-color: #66cc22;
//     .icon-arrow {
//         display: inline-block;
//         vertical-align: middle;
//         width: 12px;
//         height: 12px;
//         background: url('../../images/icon.png') -121px -203px no-repeat;
//         background-size: 150px;
//     }
//     h1 {
//         display: inline-block;
//         font-weight: normal;
//         font-size: 18px;
//         vertical-align: middle;
//         line-height: 44px;
//         white-space: nowrap;
//         text-overflow: ellipsis;
//         overflow: hidden;
//         color: #ffffff;
//     }
//     .m-icon {
//         width: 42px;
//         height: 44px;
//         background: url('../../images/icon.png') no-repeat;
//         background-size: 150px;
//         cursor: pointer;
//         text-align: left;
//         text-indent: -9999px;
//         position: absolute;
//         top: 0;
//     }
//     .lt-bar {
//         left: 0;
//     }
//     .rt-bar {
//         right: 0;
//         width: 42px;
//         height: 44px;
//         line-height: 44px;
//         font-size: 14px;
//         cursor: pointer;
//         text-align: left;
//         color: #fff;
//         position: absolute;
//         top: 0;
//     }
//     .icon-back {
//         background-position: -78px -158px;
//     }
//     .icon-more {
//         background-position: 11px -268px;
//     }
// }