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;
}

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

13. Linux上CUDA的安装

这个专栏记录我学习/科研过程中遇到的一些小问题以及解决方案,一些问题可能比较蠢请见谅。自用,仅供参考。 ------------------------------------------------------------------------------------ Linux上CUDA的安装 在安装之前,首先要确…

ThinkPHP6门面(Facade)

门面 门面(Facade) 门面为容器中的(动态)类提供了一个静态调用接口,相比于传统的静态方法调用, 带来了更好的可测试性和扩展性,你可以为任何的非静态类库定义一个facade类。 系统已经为大部分…

(计算机毕设)基于SpringBoot+Vue的房屋租赁系统的设计与实现

博主可接毕设设计!!! 各种毕业设计源码只要是你有的题目我这里都有源码 摘 要 社会的发展和科学技术的进步,互联网技术越来越受欢迎。网络计算机的生活方式逐渐受到广大人民群众的喜爱,也逐渐进入了每个用户的使用。互…

[Admin] Dashboard Filter for Mix Report Types

Background RevOps team has built a dashboard for sales team to track team members’ performance, but they’re blocked by how to provide a manager view based on sales’ hierarchy. Therefore, they seek for dev team’s help to clear their blocker. From foll…

游戏引擎学习第19天

介绍 这段内容描述了开发者在进行游戏开发时,对于音频同步和平台层的理解和调整的过程。以下是更详细的复述: 开发者表达了他希望今天继续进行的工作内容。他提到,昨天他讲解了一些关于音频的内容,今天他想稍微深入讲解一下他正…

高阶云服务-ELB+AS

ELBAS 弹性负载均衡弹性伸缩 原来1台web服务器不满足相应,现部署多台提供相同服务; 由于多个服务器多个ip该如何提供给应用呢? 引申出负载均衡(HAProxy,LVS01四层,Nginx七层) 防单点故障做主备…

STM32设计防丢防摔智能行李箱-分享

目录 目录 前言 一、本设计主要实现哪些很“开门”功能? 二、电路设计原理图 1.电路图采用Altium Designer进行设计: 2.实物展示图片 三、程序源代码设计 四、获取资料内容 前言 随着科技的不断发展,嵌入式系统、物联网技术、智能设备…

Mysql中REPLACE INTO详解及和INSERT INTO的区别

前言 我们在进行数据库操作的时候,经常会遇到这样的场景: 首先判断数据是否存在;如果不存在,则插入;如果存在,则更新。 博主之前是是Java来进行逻辑判断,例如: 看起来似乎也很简洁…

基于Java Springboot发艺美发店管理系统

一、作品包含 源码数据库设计文档万字PPT全套环境和工具资源部署教程 二、项目技术 前端技术:Html、Css、Js、Vue、Element-ui 数据库:MySQL 后端技术:Java、Spring Boot、MyBatis 三、运行环境 开发工具:IDEA/eclipse 数据…

element ui 走马灯一页展示多个数据实现

element ui 走马灯一页展示多个数据实现 element ui 走马灯一页展示多个数据实现 element ui 走马灯一页展示多个数据实现 主要是对走马灯的数据的操作,先看js处理 let list [{ i: 1, name: 1 },{ i: 2, name: 2 },{ i: 3, name: 3 },{ i: 4, name: 4 },]let newL…

ACM招新赛<赛后题解与反思总结>③

问题 A: 数数(Easy) 题目描述 某一天,工作室需要统计人数,现在小劉开始数人数,但是由于小劉数学极差,因此他数数的时候总是会忘记数数字8,也就是说他数完7以后,就会直接数数字9,直观的讲就是数字…

网络安全:我们的安全防线

在数字化时代,网络安全已成为国家安全、经济发展和社会稳定的重要组成部分。网络安全不仅仅是技术问题,更是一个涉及政治、经济、文化、社会等多个层面的综合性问题。从宏观到微观,网络安全的重要性不言而喻。 宏观层面:国家安全与…

八、鸿蒙开发-网络请求、应用级状态管理

提示:本文根据b站尚硅谷2024最新鸿蒙开发HarmonyOS4.0鸿蒙NEXT星河版零基础教程课整理 链接指引 > 尚硅谷2024最新鸿蒙开发HarmonyOS4.0鸿蒙NEXT星河版零基础教程 文章目录 一、网络请求1.1 申请网络访问权限1.2 安装axios库1.2.1 配置环境变量1.2.2 第二步&…

【MySQL实战45讲笔记】基础篇——MySQL 的基础架构

目录 1. MySQL 的基础架构1.1 连接器1.2 查询缓存1.3 分析器1.4 优化器1.5 执行器 1. MySQL 的基础架构 我们由一个问题引入对MySQL 基础架构的学习:一条SQL查询语句是如何执行的? mysql> select * from T where ID10;通过分析学习MySQL…

计算机网络 (5)数据通信的基础知识

前言 数据通信是一种以信息处理技术和计算机技术为基础的通信方式,它通过数据通信系统将数据以某种信号方式从一处传送到另一处,为计算机网络的应用和发展提供了技术支持和可靠的通信环境,是现代通信技术的关键部分。 一、数据通信的基本概念…

【操作系统笔记】目录

【操作系统笔记】操作系统框架https://blog.csdn.net/Resurgence03/article/details/142624262 【操作系统笔记】CPU管理https://blog.csdn.net/Resurgence03/article/details/142621526 【操作系统笔记】内存管理https://blog.csdn.net/Resurgence03/article/details/142669…

linux之调度管理(7)-SMP cpu 的spin-table启动

一、smp启动总体介绍 soc在启动阶段除了一些特殊情况外(如为了加快启动速度,在bl2阶段通过并行加载方式同时加载bl31、bl32和bl33镜像),一般都没有并行化需求。因此只需要一个cpu执行启动流程即可,这个cpu被称为primar…

基于Java Springboot活力健身馆管理系统

一、作品包含 源码数据库设计文档万字PPT全套环境和工具资源部署教程 二、项目技术 前端技术:Html、Css、Js、Vue、Element-ui 数据库:MySQL 后端技术:Java、Spring Boot、MyBatis 三、运行环境 开发工具:IDEA/eclipse 数据…

BERT-TFBS:一种基于 BERT 的新型模型,通过迁移学习预测转录因子结合位点

转录因子(TF)是通过结合 DNA 序列中的转录因子结合位点(TFBS)来调控基因转录所必需的蛋白质。准确预测 TFBS 有助于设计和构建基于 TF 的代谢调控系统。尽管已经开发了各种用于预测 TFBS 的深度学习算法,但预测性能仍有…

前端pdf预览方案

前端pdf预览方案 pdf预览一般不需要前端生成pdf文件,pdf文件一般是通过接口,获取pdf文件【responseType:‘blob’,】或二进制文件流【responseType: ‘arraybuffer’,】或者已有的pdf文件。 前端PDF预览通常是通过读取现有的PDF文件,并使用…