flex布局样式 类名化scss(sass)

sass 和less 语法有差异需要转化一下


$directionList: row, row-reverse, column, column-reverse;
$justifyContentList: flex-start, flex-end, center, space-between, space-around, space-evenly;
$alignItemsList: flex-start, flex-end, center, baseline, stretch;@mixin generateFlex($dr, $JC, $AI, $dir, $jc, $ai) {@if ($ai == center) {// flex-x-center.flex-#{$dr}-#{$JC} {display: flex;flex-direction: $dir;justify-content: $jc;align-items: center;}} @else {.flex-#{$dr}-#{$JC}-#{$AI} {display: flex;flex-direction: $dir;justify-content: $jc;align-items: $ai;}}
}@each $dir in $directionList {$dr: if($dir == row, x, if($dir == column, y, $dir));@each $jc in $justifyContentList {$JC: if($jc == flex-start, start, if($jc == flex-end, end, if($jc == space-between, between, if($jc == space-evenly, evenly, if($jc == space-around, around, $jc)))));@each $ai in $alignItemsList {$AI: if($ai == flex-start, start, if($ai == flex-end, end, $ai));@include generateFlex($dr, $JC, $AI, $dir, $jc, $ai);}}
}

编译后

.flex-x-start-start {align-items: flex-start;display: flex;flex-direction: row;justify-content: flex-start;
}
.flex-x-start-end {align-items: flex-end;display: flex;flex-direction: row;justify-content: flex-start;
}
.flex-x-start {align-items: center;display: flex;flex-direction: row;justify-content: flex-start;
}
.flex-x-start-baseline {align-items: baseline;display: flex;flex-direction: row;justify-content: flex-start;
}
.flex-x-start-stretch {align-items: stretch;display: flex;flex-direction: row;justify-content: flex-start;
}
.flex-x-end-start {align-items: flex-start;display: flex;flex-direction: row;justify-content: flex-end;
}
.flex-x-end-end {align-items: flex-end;display: flex;flex-direction: row;justify-content: flex-end;
}
.flex-x-end {align-items: center;display: flex;flex-direction: row;justify-content: flex-end;
}
.flex-x-end-baseline {align-items: baseline;display: flex;flex-direction: row;justify-content: flex-end;
}
.flex-x-end-stretch {align-items: stretch;display: flex;flex-direction: row;justify-content: flex-end;
}
.flex-x-center-start {align-items: flex-start;display: flex;flex-direction: row;justify-content: center;
}
.flex-x-center-end {align-items: flex-end;display: flex;flex-direction: row;justify-content: center;
}
.flex-x-center {align-items: center;display: flex;flex-direction: row;justify-content: center;
}
.flex-x-center-baseline {align-items: baseline;display: flex;flex-direction: row;justify-content: center;
}
.flex-x-center-stretch {align-items: stretch;display: flex;flex-direction: row;justify-content: center;
}
.flex-x-between-start {align-items: flex-start;display: flex;flex-direction: row;justify-content: space-between;
}
.flex-x-between-end {align-items: flex-end;display: flex;flex-direction: row;justify-content: space-between;
}
.flex-x-between {align-items: center;display: flex;flex-direction: row;justify-content: space-between;
}
.flex-x-between-baseline {align-items: baseline;display: flex;flex-direction: row;justify-content: space-between;
}
.flex-x-between-stretch {align-items: stretch;display: flex;flex-direction: row;justify-content: space-between;
}
.flex-x-around-start {align-items: flex-start;display: flex;flex-direction: row;justify-content: space-around;
}
.flex-x-around-end {align-items: flex-end;display: flex;flex-direction: row;justify-content: space-around;
}
.flex-x-around {align-items: center;display: flex;flex-direction: row;justify-content: space-around;
}
.flex-x-around-baseline {align-items: baseline;display: flex;flex-direction: row;justify-content: space-around;
}
.flex-x-around-stretch {align-items: stretch;display: flex;flex-direction: row;justify-content: space-around;
}
.flex-row-reverse-start-start {align-items: flex-start;display: flex;flex-direction: row-reverse;justify-content: flex-start;
}
.flex-row-reverse-start-end {align-items: flex-end;display: flex;flex-direction: row-reverse;justify-content: flex-start;
}
.flex-row-reverse-start {align-items: center;display: flex;flex-direction: row-reverse;justify-content: flex-start;
}
.flex-row-reverse-start-baseline {align-items: baseline;display: flex;flex-direction: row-reverse;justify-content: flex-start;
}
.flex-row-reverse-start-stretch {align-items: stretch;display: flex;flex-direction: row-reverse;justify-content: flex-start;
}
.flex-row-reverse-end-start {align-items: flex-start;display: flex;flex-direction: row-reverse;justify-content: flex-end;
}
.flex-row-reverse-end-end {align-items: flex-end;display: flex;flex-direction: row-reverse;justify-content: flex-end;
}
.flex-row-reverse-end {align-items: center;display: flex;flex-direction: row-reverse;justify-content: flex-end;
}
.flex-row-reverse-end-baseline {align-items: baseline;display: flex;flex-direction: row-reverse;justify-content: flex-end;
}
.flex-row-reverse-end-stretch {align-items: stretch;display: flex;flex-direction: row-reverse;justify-content: flex-end;
}
.flex-row-reverse-center-start {align-items: flex-start;display: flex;flex-direction: row-reverse;justify-content: center;
}
.flex-row-reverse-center-end {align-items: flex-end;display: flex;flex-direction: row-reverse;justify-content: center;
}
.flex-row-reverse-center {align-items: center;display: flex;flex-direction: row-reverse;justify-content: center;
}
.flex-row-reverse-center-baseline {align-items: baseline;display: flex;flex-direction: row-reverse;justify-content: center;
}
.flex-row-reverse-center-stretch {align-items: stretch;display: flex;flex-direction: row-reverse;justify-content: center;
}
.flex-row-reverse-between-start {align-items: flex-start;display: flex;flex-direction: row-reverse;justify-content: space-between;
}
.flex-row-reverse-between-end {align-items: flex-end;display: flex;flex-direction: row-reverse;justify-content: space-between;
}
.flex-row-reverse-between {align-items: center;display: flex;flex-direction: row-reverse;justify-content: space-between;
}
.flex-row-reverse-between-baseline {align-items: baseline;display: flex;flex-direction: row-reverse;justify-content: space-between;
}
.flex-row-reverse-between-stretch {align-items: stretch;display: flex;flex-direction: row-reverse;justify-content: space-between;
}
.flex-row-reverse-around-start {align-items: flex-start;display: flex;flex-direction: row-reverse;justify-content: space-around;
}
.flex-row-reverse-around-end {align-items: flex-end;display: flex;flex-direction: row-reverse;justify-content: space-around;
}
.flex-row-reverse-around {align-items: center;display: flex;flex-direction: row-reverse;justify-content: space-around;
}
.flex-row-reverse-around-baseline {align-items: baseline;display: flex;flex-direction: row-reverse;justify-content: space-around;
}
.flex-row-reverse-around-stretch {align-items: stretch;display: flex;flex-direction: row-reverse;justify-content: space-around;
}
.flex-y-start-start {align-items: flex-start;display: flex;flex-direction: column;justify-content: flex-start;
}
.flex-y-start-end {align-items: flex-end;display: flex;flex-direction: column;justify-content: flex-start;
}
.flex-y-start {align-items: center;display: flex;flex-direction: column;justify-content: flex-start;
}
.flex-y-start-baseline {align-items: baseline;display: flex;flex-direction: column;justify-content: flex-start;
}
.flex-y-start-stretch {align-items: stretch;display: flex;flex-direction: column;justify-content: flex-start;
}
.flex-y-end-start {align-items: flex-start;display: flex;flex-direction: column;justify-content: flex-end;
}
.flex-y-end-end {align-items: flex-end;display: flex;flex-direction: column;justify-content: flex-end;
}
.flex-y-end {align-items: center;display: flex;flex-direction: column;justify-content: flex-end;
}
.flex-y-end-baseline {align-items: baseline;display: flex;flex-direction: column;justify-content: flex-end;
}
.flex-y-end-stretch {align-items: stretch;display: flex;flex-direction: column;justify-content: flex-end;
}
.flex-y-center-start {align-items: flex-start;display: flex;flex-direction: column;justify-content: center;
}
.flex-y-center-end {align-items: flex-end;display: flex;flex-direction: column;justify-content: center;
}
.flex-y-center {align-items: center;display: flex;flex-direction: column;justify-content: center;
}
.flex-y-center-baseline {align-items: baseline;display: flex;flex-direction: column;justify-content: center;
}
.flex-y-center-stretch {align-items: stretch;display: flex;flex-direction: column;justify-content: center;
}
.flex-y-between-start {align-items: flex-start;display: flex;flex-direction: column;justify-content: space-between;
}
.flex-y-between-end {align-items: flex-end;display: flex;flex-direction: column;justify-content: space-between;
}
.flex-y-between {align-items: center;display: flex;flex-direction: column;justify-content: space-between;
}
.flex-y-between-baseline {align-items: baseline;display: flex;flex-direction: column;justify-content: space-between;
}
.flex-y-between-stretch {align-items: stretch;display: flex;flex-direction: column;justify-content: space-between;
}
.flex-y-around-start {align-items: flex-start;display: flex;flex-direction: column;justify-content: space-around;
}
.flex-y-around-end {align-items: flex-end;display: flex;flex-direction: column;justify-content: space-around;
}
.flex-y-around {align-items: center;display: flex;flex-direction: column;justify-content: space-around;
}
.flex-y-around-baseline {align-items: baseline;display: flex;flex-direction: column;justify-content: space-around;
}
.flex-y-around-stretch {align-items: stretch;display: flex;flex-direction: column;justify-content: space-around;
}
.flex-column-reverse-start-start {align-items: flex-start;display: flex;flex-direction: column-reverse;justify-content: flex-start;
}
.flex-column-reverse-start-end {align-items: flex-end;display: flex;flex-direction: column-reverse;justify-content: flex-start;
}
.flex-column-reverse-start {align-items: center;display: flex;flex-direction: column-reverse;justify-content: flex-start;
}
.flex-column-reverse-start-baseline {align-items: baseline;display: flex;flex-direction: column-reverse;justify-content: flex-start;
}
.flex-column-reverse-start-stretch {align-items: stretch;display: flex;flex-direction: column-reverse;justify-content: flex-start;
}
.flex-column-reverse-end-start {align-items: flex-start;display: flex;flex-direction: column-reverse;justify-content: flex-end;
}
.flex-column-reverse-end-end {align-items: flex-end;display: flex;flex-direction: column-reverse;justify-content: flex-end;
}
.flex-column-reverse-end {align-items: center;display: flex;flex-direction: column-reverse;justify-content: flex-end;
}
.flex-column-reverse-end-baseline {align-items: baseline;display: flex;flex-direction: column-reverse;justify-content: flex-end;
}
.flex-column-reverse-end-stretch {align-items: stretch;display: flex;flex-direction: column-reverse;justify-content: flex-end;
}
.flex-column-reverse-center-start {align-items: flex-start;display: flex;flex-direction: column-reverse;justify-content: center;
}
.flex-column-reverse-center-end {align-items: flex-end;display: flex;flex-direction: column-reverse;justify-content: center;
}
.flex-column-reverse-center {align-items: center;display: flex;flex-direction: column-reverse;justify-content: center;
}
.flex-column-reverse-center-baseline {align-items: baseline;display: flex;flex-direction: column-reverse;justify-content: center;
}
.flex-column-reverse-center-stretch {align-items: stretch;display: flex;flex-direction: column-reverse;justify-content: center;
}
.flex-column-reverse-between-start {align-items: flex-start;display: flex;flex-direction: column-reverse;justify-content: space-between;
}
.flex-column-reverse-between-end {align-items: flex-end;display: flex;flex-direction: column-reverse;justify-content: space-between;
}
.flex-column-reverse-between {align-items: center;display: flex;flex-direction: column-reverse;justify-content: space-between;
}
.flex-column-reverse-between-baseline {align-items: baseline;display: flex;flex-direction: column-reverse;justify-content: space-between;
}
.flex-column-reverse-between-stretch {align-items: stretch;display: flex;flex-direction: column-reverse;justify-content: space-between;
}
.flex-column-reverse-around-start {align-items: flex-start;display: flex;flex-direction: column-reverse;justify-content: space-around;
}
.flex-column-reverse-around-end {align-items: flex-end;display: flex;flex-direction: column-reverse;justify-content: space-around;
}
.flex-column-reverse-around {align-items: center;display: flex;flex-direction: column-reverse;justify-content: space-around;
}
.flex-column-reverse-around-baseline {align-items: baseline;display: flex;flex-direction: column-reverse;justify-content: space-around;
}
.flex-column-reverse-around-stretch {align-items: stretch;display: flex;flex-direction: column-reverse;justify-content: space-around;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/61267.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【phpseclib】 PHP 使用加密算法 RSA、DES、AES等

一、Composer 下载 phpseclib # 我使用的是 phpseclib3 composer require phpseclib/phpseclib二、RSA 加密解密 // 我使用的是 phpseclib3use phpseclib3\Crypt\RSA;$type PKCS8; // 看需求选其一, PKCS8 | PKCS1 | JWK | MSBLOB | OpenSSH | PSS | PuTTY | Raw | WML $rsa…

labview中的调用链

在有些项目中会用到调用链,用我自己的理解来说就像是递归函数那样层层调用,然后结果回退到第一次开始调用的main函数哪里,这里对于传值的时候还是非常好用,通过更改子VI然后来改变主VI的里面函数的值来实现这个效果。 我们可以看…

django从入门到实战(四)——模型与数据库

1. 模型的定义与数据迁移 1.1 模型的定义 在 Django 中,模型是一个 Python 类,用于定义数据库中的数据结构。每个模型类对应数据库中的一张表,类的属性对应表中的字段。 示例: from django.db import modelsclass Blog(models…

MySQL初学之旅(3)约束

目录 1.前言 2.正文 2.1约束类型 2.2NULL约束 2.3UNIQUE约束 2.4DEFAULT约束 2.5PRIMARY KEY主键约束 2.6FOREIGN KEY外键约束 2.7CHECK约束 3.小结 1.前言 哈喽大家好啊,今儿来继续给大家分享最近学习的MySQL和约束相关的知识点,希望大家一起…

Ubuntu Linux使用前准备动作 配置SSH

在 Ubuntu 系统中配置 SSH 服务可以通过以下步骤进行: 1、安装ssh服务 1)打开终端(可以使用快捷键 Ctrl Alt T)。 2)运行以下命令安装 OpenSSH 服务器: sudo apt-get update:这一步是更新…

网络爬虫 Python-(初始篇1 后期照样有)

一、网络爬虫基础概念 定义:网络爬虫(Web Crawler)也叫网络蜘蛛(Web Spider),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本。它可以从网页上获取各种数据,比如文本内容…

在MATLAB中实现自适应滤波算法

自适应滤波算法是一种根据信号特性自动调整滤波参数的数字信号处理方法,其可以有效处理噪声干扰和信号畸变问题。在许多实时数据处理系统中,自适应滤波算法得到了广泛应用。在MATLAB中,可以使用多种方法实现自适应滤波算法。本文将介绍自适应…

wordpress独立站首页调用产品的三种方法

在WordPress独立站中,展示最新产品、最热门产品和推荐产品是吸引用户和促进销售的重要手段。以下是三种实现这些功能的方法: 1. 使用WooCommerce内置功能 如果你的WordPress站点使用了WooCommerce插件来管理产品,你可以利用它的内置功能来展…

解决BUG: Since 17.0, the “attrs“ and “states“ attributes are no longer used.

从Odoo 17.0开始,attrs和states属性不再使用,取而代之的是使用depends和domain属性来控制字段的可见性和其他行为。如果您想要在选择国家之后继续选择州,并且希望在选择了国家之后才显示州字段,您可以使用depends属性来实现这一点…

【Vue笔记】基于vue3 + element-plus + el-dialog封装一个自定义的dialog弹出窗口组件

这篇文章,介绍一下如何使用vue3+element-plus中的el-dialog组件,自己封装一个通用的弹出窗口组件。运行效果如下所示: 目录 1.1、父子组件通信 1.2、自定义VDialog组件(【v-model】模式) 1.2.1、编写VDialog组件代码 1.2.2、使用VDialog组件 1.2.3、运行效果 1.3、自…

学习笔记024——Ubuntu 安装 Redis遇到相关问题

目录 1、更新APT存储库缓存: 2、apt安装Redis: 3、如何查看检查 Redis版本: 4、配置文件相关设置: 5、重启服务,配置生效: 6、查看服务状态: 1、更新APT存储库缓存: sudo apt…

【Next】中间件

概述 Next.js 的 中间件 (Middleware) 是一种在请求完成之前运行的函数,用于对入站请求进行处理和操作。它可以在路由匹配前执行逻辑,用于身份验证、请求重写、重定向、设置响应头等任务。 使用场景 身份验证:在用户访问页面前检查登录状态…

学习记录:js算法(九十九):冗余连接

文章目录 冗余连接思路一 冗余连接 树可以看成是一个连通且 无环 的 无向 图。 给定往一棵 n 个节点 (节点值 1~n) 的树中添加一条边后的图。添加的边的两个顶点包含在 1 到 n 中间,且这条附加的边不属于树中已存在的边。图的信息记录于长度为 n 的二维数…

记录———封装uni-app+vant(u-upload)上传图片组件

上传图片回显,自定义图片回显样式 这段代码是一个Vue组件,主要实现了图片上传和预览的功能。组件接收了父组件传递的图片列表、最大图片数量和上传状态等属性。在模板中,使用了uni-easyinput组件和u-upload组件来实现图片上传和预览功能。在…

【图像处理识别】数据集合集!

本文将为您介绍经典、热门的数据集,希望对您在选择适合的数据集时有所帮助。 1 CNN-ImageProc-Robotics 机器人 更新时间:2024-07-29 访问地址: GitHub 描述: 通过 CNN 和图像处理进行机器人对象识别项目侧重于集成最先进的深度学习技术和…

python-docx 用法

一、简介 python-docx 是一个非常流行的第三方 Python 库,用于创建、修改和读取 Microsoft Word 文档(.docx 文件)。该库功能强大且易于使用,常用于自动化生成报告、格式化文档或从 Word 文档中提取信息。 二、常见用法 1. 安装…

高亮变色显示文本中的关键字

效果 第一步:按如下所示代码创建一个用来高亮显示文本的工具类: public class KeywordUtil {/*** 单个关键字高亮变色* param color 变化的色值* param text 文字* param keyword 文字中的关键字* return*/public static SpannableString highLigh…

Python Web 开发的路径管理艺术:FastAPI 项目中的最佳实践与问题解析20241119

Python Web 开发的路径管理艺术:FastAPI 项目中的最佳实践与问题解析 引言:从路径错误到模块化管理的技术旅程 在现代 Python Web 开发中,路径管理是一个常常被忽视却非常重要的问题。尤其是在使用像 FastAPI 和 Tortoise ORM 这样的框架时…

[javascript]js的五子棋让红蓝双方自己跟自己下棋

运行效果&#xff08;这是未分出胜负&#xff09;&#xff1a; 这是分出胜负&#xff1a; 源代码&#xff0c;把下边的代码放到1.html&#xff0c;然后用浏览器打开&#xff0c;就可以&#xff0c;然后刷新网页&#xff1a; <!DOCTYPE html> <html><body>&l…

【list的模拟实现】—— 我与C++的模拟实现(十四)

一、list节点 ​ list是一个双向循环带头的链表&#xff0c;所以链表节点结构如下&#xff1a; template<class T>struct ListNode{T val;ListNode* next;ListNode* prve;ListNode(int x){val x;next prve this;}};二、list迭代器 2.1、list迭代器与vector迭代器区别…