哥伦布

CSS自己封装的样式库

_variable.scss

复制代码
/* 媒体查询 */
$decktop: 1200px;
$laptop: 1024px;
$tablet: 768px;
$phone: 480px;

/* 主题状态颜色 */
$theme: #7957d5;
$success: #67c23a;
$waring: #e6a23c;
$danger: #f56c6c;
$info: #909399;
$light:hsl(0, 0%, 96%);//浅色
$dark:hsl(0, 0%, 21%);//深色

/* 基础颜色 */
$black:#000000;
$white:#FFFFFF;
$transparent:transparent;

/* 文字颜色 */
$fc-1:#303133;//主要文字
$fc-2:#606266;//常规文字
$fc-3:#909399;//次要文字
$fc-4:#C0C4CC;//占位文字

/* 边框颜色 */
$bc-1:#DCDFE6;//一级边框
$bc-2:#E4E7ED;//二级边框
$bc-3:#EBEEF5;//三级边框
$bc-4:#F2F6FC;//四级边框

/* 字体大小 */
$fs-12: 12px;
$fs-14: 14px;
$fs-16: 16px;
$fs-18: 18px;
$fs-20: 20px;
$fs-22: 22px;
$fs-24: 24px;
$fs-26: 26px;
$fs-28: 28px;
复制代码

reset.scss

复制代码
@import "./variable";

/* 重置样式 */
* {
    padding: 0;
    margin: 0;
    line-height: 1;
}

html,
body {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}
button {
    border: 0;
}
a {
    text-decoration: none;
    font-size: 16px;
    color: #333333;
    font-weight: 500;
}
ul,
li,
ol {
    list-style: none;
}
textarea,
input {
    width: 100%;
    height: 100%;
    border: 0;
    resize: none;
    outline: none;
}

::-webkit-scrollbar {
    display: none;
}
/* 重置样式end */

/* 自定义类名 */

/* 一行文字换行和字体溢出隐藏 */
.One-line-hide {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 多行(定义行)文字和字体溢出隐藏 */
.Multi-line-hide {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
/* 鼠标悬停显示隐藏省略文字 */
.hoverShow {
    text-overflow: inherit;
    overflow: visible;
    white-space: nowrap;
}
/* 字体删除线 */
.Strikethrough {
    text-decoration: line-through;
}
/* 字体首位大写*/
.toFirstCapital {
    text-transform: capitalize;
}

/* 字体大写*/
.toFirstCapital {
    text-transform: uppercase;
}

/* 字体小写*/
.toCapital {
    text-transform: lowercase;
}

/* iconfont */
.iconfont {
    cursor: pointer;
}
.iconfont:hover {
    color: $theme;
}
/* 主题状态颜色 */
.theme {
    color: $theme;
}
.success {
    color: $success;
}
.waring {
    color: $waring;
}
.danger {
    color: $danger;
}
.info {
    color: $info;
}
.light {
    color: $light;
}
.dark {
    color: $dark;
}

/* 基础颜色 */
.black {
    color: $black;
}
.white {
    color: $white;
}
.transparent {
    color: $transparent;
}

/* 文字颜色 */
.fc-1 {
    color: $fc-1;
}
.fc-2 {
    color: $fc-2;
}
.fc-3 {
    color: $fc-3;
}
.fc-4 {
    color: $fc-4;
}

/* 边框颜色 */
.bc-1 {
    color: $bc-1;
}
.bc-2 {
    color: $bc-2;
}
.bc-3 {
    color: $bc-3;
}
.bc-4 {
    color: $bc-4;
}

/* 字体大小 */
.fs-12 {
    font-size: $fs-12;
}
.fs-14 {
    font-size: $fs-14;
}
.fs-16 {
    font-size: $fs-16;
}
.fs-18 {
    font-size: $fs-18;
}
.fs-20 {
    font-size: $fs-20;
}
.fs-22 {
    font-size: $fs-22;
}
.fs-24 {
    font-size: $fs-24;
}
.fs-26 {
    font-size: $fs-26;
}
.fs-28 {
    font-size: $fs-28;
}

/* 弹性布局 */
.is-flex {
    display: flex;
}
/* Flex direction */
.flex-direction-row {
    flex-direction: row;
}
.flex-direction-row-reverse {
    flex-direction: row-reverse;
}
.flex-direction-column {
    flex-direction: column;
}
.flex-direction-column-reverse {
    flex-direction: column-reverse;
}

/* Flex wrap */
.flex-wrap-nowrap {
    flex-wrap: nowrap;
}
.flex-wrap-wrap {
    flex-wrap: wrap;
}
.flex-wrap-wrap-reverse {
    flex-wrap: wrap-reverse;
}

/* Justify content */
.justify-content-flex-start {
    justify-content: flex-start;
}
.justify-content-flex-end {
    justify-content: flex-end;
}
.justify-content-center {
    justify-content: center;
}
.justify-content-space-between {
    justify-content: space-between;
}
.justify-content-space-around {
    justify-content: space-around;
}
.justify-content-space-evenly {
    justify-content: space-evenly;
}
.justify-content-start {
    justify-content: start
}
.justify-content-end{
    justify-content: end
}
.justify-content-left {
    justify-content: left
}
.justify-content-right {
    justify-content: right
}

/* Align content */
.align-content-flex-start {
    align-content: flex-start;
}
.align-content-flex-end {
    align-content: flex-end
}
.align-content-center {
    align-content: center
}
.align-content-space-between {
    align-content: space-between
}
.align-content-space-around {
    align-content: space-around
}
.align-content-space-evenly {
    align-content: space-evenly
}
.align-content-stretch {
    align-content: stretch
}
.align-content-start {
    align-content: start
}
.align-content-end{
    align-content: end
}
.align-content-baseline{
    align-content: baseline
}

/* Align items */
.align-items-stretch{
    align-items: stretch
}
.align-items-flex-start{
    align-items: flex-start
}
.align-items-flex-end{
    align-items: flex-end
}
.align-items-center{
    align-items: center
}
.align-items-baseline{
    align-items: baseline
}
.align-items-start{
    align-items: start
}
.align-items-end{
    align-items: end
}
.align-items-self-start{
    align-items: self-start
}
.align-items-stretch{
    align-items: self-end
}

/* Align self */
.align-self-auto{
    align-self: auto
}
.align-self-flex-start{
    align-self: flex-start
}
.align-self-flex-end{
    align-self: flex-end
}
.align-self-center{
    align-self: center
}
.align-self-baseline{
    align-self: baseline
}
.align-self-stretch{
    align-self: stretch
}
/* flex-1 */
.flex-1{
    flex: 1;
}

/* 自定义原生input-type:file上传图片,隐藏原生上传图标 */
.uploadImg {
    position: relative;
    .uploadImgInput {
        cursor: pointer !important;
        width: 1.46rem;
        height: 100%;
        z-index: 10000;
        opacity: 0;
        position: absolute;
        left: 0;
    }
}

/* 页面统一样式自定义 */
.wrap {
    width: 100vw;
    height: 100vh;
    background-color: rgba(230, 230, 230, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}
.navbars {
    width: 100%;
    background-image: linear-gradient(to right, #feac5e, #c779d0, #4bc0c8);
}

/* 自定义类名end */

@media screen and (max-width: $tablet) {
    textarea {
        font-size: $fs-14;
    }

    .iconfont {
        font-size: $fs-18;
    }
    .navbars {
        height: 38px;
    }
}

@media screen and (min-width: $tablet) {
    textarea {
        font-size: $fs-18;
    }

    .iconfont {
        font-size: $fs-22;
    }
    .navbars {
        height: 48px;
    }
}
复制代码

 

posted @   南柯Dream丶  阅读(153)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示