_index.scss 2.99 KB
@charset "utf-8";
/*
 * @description: index css
 * @author: chenglong.wang@yoho.cn
 * @date: 2015/4/16
 */

//content
.home-content {
    margin: 20px 15px 0 15px;

    @each $channel in fashion, lifestyle, video {
        .channel-#{$channel} {
            .img-link {
                position: relative;
                display: block;
                width: 290px;
                height: 185px;

                &:after {
                    content: '';
                    @include retina-sprite($icons, channel-#{$channel});
                    position: absolute;
                    right: -5px;
                    bottom: -5px;
                }

                img {
                    width: 100%;
                    height: auto;
                }
            }
        }
    }

    #pop {
        .img-link {
            width: 290px;
            height: 390px;
            background: #ffe558;
            overflow: hidden;
            padding: 30px 10px 10px 10px;
            @include box-sizing();

            &:before {
                content: '';
                @include retina-sprite($icons, pop, true, false);
                top: 4px;
            }

            &:after {
                display: none;
            }
            img {
                width: 270px;
                height: 350px;
                margin: 0 auto;
                display: block;
                overflow: hidden;
            }
        }
    }

    .content-item {
        width: 100%;
        height: auto;
        margin-bottom: 35px;
        padding-bottom: 35px;
        border-bottom: 1px solid #272727;

        > h2, > h3, > time {
            text-align: center;
            display: block;
            width: 100%;
        }

        > h2, > time {
            margin-top: 15px;
        }

        > h2, > h3 {
            line-height: 24px;
            font-size: 2rem;
            font-weight: bold;
            color: #000;
        }

        > h3 {
            margin-top: 2px;
        }

        > time {
            font-size: 1.4rem;
            font-weight: normal;
            color: #999;
            text-transform: capitalize;

            a {
                color: #999;
            }
        }
        > p {
            line-height: 23px;
            margin-top: 12px;
            text-align: center;
            display: block;
            width: 100%;
            font-size: 1.4rem;

            a {
                color: #000;
                display: block;
            }
        }
    }
}

@each $channelColor, $channelTitle in (fashion, #9b90ff),
    (beauty, #ffcaca),
    (sport, #84e3ca),
    (lifestyle, #ffca72),
    (magazine, #7ecaff),
    (video, #c9caca) {


    ##{$channelColor} {
        //各频道角标颜色
        .img-link {
            &:after {
                @include retina-sprite($icons, channel-#{$channelColor});
            }
        }

        //各频道主副标题颜色
        .content-item {

            > h2, h3 {
                color: $channelTitle;
            }
        }
    }
}