amis/packages/amis-ui/scss/_mixins.scss
qinhaoyan c1a8a498e2
feat:新版主题、新版图标 (#5588)
* fix: Wizard组件点击下一步会多提交一次问题 (#4729)

* feat: 新 icon 选择器优化, 解决冲突

* feat: 新 icon 选择器 准备提交

* feat: 新 icon 选择器

* feat: 新 icon 选择器

* feat: 新 icon 选择器, 类型报错修复

* feat: 修改

* feat: 修改 scss

* feat: 修改

* 新版主题——button(实验中) (#4920)

* styles:新版主题——button

* styles: 主题button

* styles: cxd主题变量

* feat: transfer组件新版主题配置 (#4975)

* feat: transfer组件新版主题配置

* feat: transfer主题配置修改

Co-authored-by: hongyang03 <hongyang03@baidu.com>

* styles:更换全局样式变量(实验性) (#5065)

* feat: icon 扩充为 object

* 修改

* feat: 增加 clearable 属性

* Theme: 全局变量替换 (#5146)

* feat: 全局变量替换

* feat: 全局变量替换

* feat: 全局变量替换

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* feat: 全局变量替换部分样式走查 (#5150)

* feat: 全局变量替换

* feat: 全局变量替换

* feat: 全局变量替换

* feat: 全局变量替换部分审查

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* style:amis4.0样式走查

* style: 修改rem直接使用的问题

* style:amis4.0样式走查 (#5165)

* style:amis4.0样式走查

* style: 修改rem直接使用的问题

Co-authored-by: zhangzheyu02 <zhangzheyu02@baidu.com>

* feat: 合并master分支到theme (#5197)

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* feat: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* fix: 点状步骤条样式修改

* test: crud interval&stopAutoRefreshWhen

* test: crud draggable&itemDraggableOn

* test: CRUD interval&stopAutoRefreshWhen

* test: 补全table selectable&itemCheckableOn属性单测

* fix: DateRangePicker取消按钮无法点击的问题

* fix: 修复DateTime组件,时间选择器高度与日期对齐

* fix: table-view 的边框只应该在 td 上设置

* fix:
    1. DateRangeTimePicker选中开始时间后,结束时间跳转到23:59
    2. DateRangePicker 点击结束时间后,日期选择窗口总是关闭

* feat: DateRangePicker 对无法选择的日期上增加disabled样式

* fix: DateRangePicker 输入日期时展示错误

* chore: 优化地理位置dispose逻辑 (#4918)

* feat: table-view 的所有属性支持变量

* docs: 补充 mapping 渲染其它 amis 组件的示例

* fix: TreeSelect多选选中后没有清空input搜索内容 (#4843)

* fix: input-tag max 属性bug修复

* fix: input-tag max 属性bug修复

* 修改

* 修改

* feat: Property 的 title 等属性支持自动变量解析 Closes #4900

* fix: 公式编辑器高亮问题 (#4945)

* fix: transfer tree 右侧无法滚动  (#4686)

* fix: Service组件Unmount方法缺失问题 (#4954)

* chore: 修复编译 warnning

* fix: #4828 Select组件搜索时输入空格错误关闭下拉框,关闭快捷键改为组合键 (#4930)

* style: Card组件按钮区图标文字间隔 (fix #4901) (#4931)

* fix: InputTag组件placeholder属性不生效问题 (#4933)

* test: 补全table selectable&itemCheckableOn属性单测
test: CRUD +  quickEdit & quickSaveApi & quickSaveItemApi & saveImmediately

* feat:ajax动作返回数据格式调整

* 修改测试用例

* 修改测试用例

* outputVar中增加数据

* 去掉字段

* chore: 补充 radios switch input-text 单测

* 修改

* 完善

* style:组件time/date/anchornav/progress/alert样式对齐4.0 (#4890)

* style:组件time/date/anchornav/progress/alert样式对齐4.0

* test:更新测试用例

* pref:日期图标替换

* test:更新测试用例

Co-authored-by: hongyang03 <hongyang03@baidu.com>

* styles: tabs、input-rating、input-text、textarea 组件样式问题修复 (#4943)

* feat: 修改

* 2

* feat: tabs

* feat: textarea

* feat: 修改

Co-authored-by: liuzedong02 <liuzedong02@baidu.com>

* style:transfer、form、pagination 4.0样式问题修改 (#4956)

Co-authored-by: sarding <hongfuquan@baidu.com>

* styles:dialog、nestedSelect、picker样式优化 (#4973)

* style:table组件对齐4.0样式 (#4964)

* style:table组件对齐4.0样式

* fix:更新table status快照

Co-authored-by: xujiahao01 <xujiahao01@baidu.com>

* fix: 公式变量点选时嵌套问题 (#4974)

* fix: 修复选项的 autoFill 会出现对象 merge 的情况

* styles:修复crud headerToolbart右对齐按钮没有间距问题

* Feat amis badge (#4962)

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* feat: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* fix: 点状步骤条样式修改

* feat: badge,steps,timeline对齐4.0

* BCE-JC-20760 feat: 合并冲突

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* fix:amis 4.0样式对齐 checkbox&select等组件 (#4878)

* fix:amis 4.0样式对齐 checkbox&select等组件

* style:修复checkbox勾选框hover上去出现小圆点

Co-authored-by: xujiahao01 <xujiahao01@baidu.com>

* fix: steps恢复子标题 (#4987)

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* feat: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* faet: Step组件支持点状步骤条、指定标签放置位置、新增超出内容显示浮层

* fix: 点状步骤条样式修改

* feat: steps样式调整

* feat: 补充steps单测

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* styles: 补全全局变量 (#4985)

* style:修复form表单按钮靠左 (#4988)

Co-authored-by: xujiahao01 <xujiahao01@baidu.com>

* amis4.0样式对齐 (#4927)

Co-authored-by: zhangzheyu02 <zhangzheyu02@baidu.com>

* fix: 排序字段中间态 orderDir 没有置空问题 (#4971)

Co-authored-by: srleng <srleng@gaojihealth.com>

* styles:修复dialog内容x轴被遮挡问题 (#4992)

* fix:TextControlSchema nativeInputClassName声明 (#4993)

* styles: 修复overflow hidden问题 (#4997)

* fix: 修复 Combo配置unique属性空字符的逻辑判断

* fix:CRUD其他模式loading不显示问题 (#5000)

* fit:CRUD其他模式loading不显示问题

* fit:CRUD其他模式loading不显示问题

* fix: 修复table中combineNum不生效 (#5003)

* test: 补充tabs单测 (#4991)

* docs: 更新执行单元测试步骤 (#4976)

* fix: select组件size=lg时展示错误  (#5008)

* fix: select组件size=lg时展示错误 (#4599)
* fix: 修复dev环境 mobile scss加载失败
* chore: update snapshot

* fix: CRUD设置超级表头后全选checkbox展示错误 (#5012)

* fix: CRUD设置超级表头后全选checkbox展示错误

* doc(HeaderGroup): 更新示例文档

Co-authored-by: RUNZE LU <36724300+lurunze1226@users.noreply.github.com>

* feat: Image组件支持innerClassName (#4977)

* fix: Checkboxes组件全选状态样式展示错误 (#5015)

* remove redundant (#4959)

* fix: SDK模式下Toast位置为top-center (resolve #4928) (#4986)

* feat: ImageGallery支持工具栏 (#5005)

* fix: Steps组件status使用变量时不生效问题 (#4983)

* fix:修复日期范围选择器样式 (#5016)

* fix:修复日期范围选择器样式

* pref:更新测试用例

* pref:去的fis轮询

Co-authored-by: hongyang03 <hongyang03@baidu.com>

* chore: 更新依赖,tinymce 到 6.1.2,echarts 到 5.3.1,qrcode.react 到 3.1.0,reac… (#5018)

* chore: 更新依赖,tinymce 到 6.1.2,echarts 到 5.3.1,qrcode.react 到 3.1.0,react 到 18.2.0

* 调整一下 tinymce 默认 toolbar

* 调整一下 tinymce 默认 toolbar

* feat: service 支持 js: 请求,使得动态渲染支持 JavaScript 函数 (#4866)

* fix: InputTable列使用默认值时无法更新到数据域的问题 (#4970)

* fix: 修复CRUD在dialog中时表头无法固定 (#4995)

* fix: 修复CRUD在dialog中时表头无法固定

* fix: 修复CRUD在dialog中时表头无法固定(用一种破坏性更小的方案)

* chore: Echarts 补充 valueFormatter 字符串函数支持 (#5023)

* fix: CRUD查询表单reset-and-submit刷新两次问题; InputText使用AutoComplete光标无法切换问题 (#5022)

Co-authored-by: tooeast <liuzedong02@baidu.com>

* fix: 兼容低版本浏览器配置table:autoFillHeight(不支持sticky) (#5020)

* v2.1.0

* test: Timeline Wizard (#5031)

* test: Timeline

* test: Wizard

* fix: 修复DateRangePicker存在多个active (#5035)

* fix: 避免 react 报控件值从 uncontrolled 到 controlled 切换 (#5032)

* fix: select 接口报错时 url 应该显示为实际请求地址 (#5033)

* feat:自定义js动作支持异步 (#5044)

* test: 补充Steps, Pagination单测 (#5034)

* test: steps

* test: pagination

* fix: ConditionBuilder disabled 后还能拖动和删除 (#4655) (#5045)

* fix: ConditionBuilder disabled 后还能拖动和删除 (#4655) (#5045)

* fix:修复table存在异步数据时,固定表头宽度错位问题 (#5036)

* fix: CRUD开启超级表头时展开列显示错误,合并列元素只有1个时无法显示remark问题 (#5047)

* docs:补充更新组件数据时获取数据域的说明 (#5055)

* docs:补充更新组件数据时获取数据域的说明

* docs:补充更新组件数据时获取数据域的说明&异步JS动作说明

* docs:补充更新组件数据时获取数据域的说明&异步JS动作说明

* fix: CRUD设置combineNum不生效 (#5059)

* fix: CRUD设置combineNum不生效

* fix: 调整table计算 header fixed 的逻辑,兼容滚动元素可能包含多个子元素

* fix: #4566 PR 补丁 [pullRefresh.disabled为 false情况下,内容区展示异常问题]

* fix:修复 CRUD组件更改columns字段不立刻生效问题 (#5077)

Co-authored-by: ”jiatianqi“ <”jiatianqi@baidu.com“>

* 修复人员组件默认值 (#5079)

Co-authored-by: zhangxulong <zhangxulong@baidu.com>

* fix: crud2 CRUD2TableSchema mode value

* fix: fix doc error caused by vulnerable example. (#5068)

* fix: tree校验问题 & minLength和maxLength属性提示问题 (#5048)

Co-authored-by: ”jiatianqi“ <”jiatianqi@baidu.com“>

* feat: Form Debug区域使用json显示; chore: 修正使用Form debug区域校验的单测 (#5056)

* fix: table中toolbar增加padding效果(#4757) (#5069)

* chore: input-number、input-range、checkbox 单测用例补充 & range style 百分比最多保留两位 (#5076)

* checkbox 单测补充

* input-number 单测补充

* input-range 单测补充 & range style 百分比最多保留两位

Co-authored-by: tooeast <liuzedong02@baidu.com>

* docs: 修复GitHub编辑链接错误,Flexbox文档链接和文件链接统一 (#5037)

* fix(CRUD): 操作栏列不下发loading (#5046)

* feat: optinos 支持配置新增和编辑的弹框属性;修复编辑属性 popover 无法显示问题;去掉代码里遗漏的 component… (#5085)

* feat: optinos 支持配置新增和编辑的弹框属性;修复编辑属性 popover 无法显示问题;去掉代码里遗漏的 componentWillMount

* 支持外部代码实现删除逻辑

* chore: 发布 2.1.1-beta.2 (#5086)

* fix: CRUD列字段无返回值时会错误展示字段值问题; chore: 修复InputRange单测 (#5094)

* style: Dialog显/隐切换卡顿问题 (#5107)

* fix: InputTable组件needConfirm为true时无法新增行问题 (#5108)

* fix: 修复导出 CSV 时如果值是对象就无法显示问题 (#5103)

* Revert "fix: 兼容低版本浏览器配置table:autoFillHeight(不支持sticky) (#5020)" (#5109)

This reverts commit f81d18c7c8.

* v2.1.1-beta.3

* docs: 修复主干版本跳转链接出错的问题 (#5099)

* fix: options 内容过多时超出显示问题 (#5112)

* fix: Page css、cssVars属性更新问题修复 (#5113)

Co-authored-by: wanglinfang <wanglinfang@baidu.com>

* fix: 锚点导航定位问题修复 (#5114)

Co-authored-by: tooeast <liuzedong02@baidu.com>

* feat: 全局变量替换

* feat: 全局变量替换

* feat: 全局变量替换

* feat: 全局变量替换部分审查

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>
Co-authored-by: meerkat <kit_hack@outlook.com>
Co-authored-by: wuduoyi <wuduoyi@baidu.com>
Co-authored-by: RickCole <rickcole21@outlook.com>
Co-authored-by: RUNZE LU <36724300+lurunze1226@users.noreply.github.com>
Co-authored-by: liuzedong02 <liuzedong02@baidu.com>
Co-authored-by: Allen <yupeng.fe@qq.com>
Co-authored-by: pianruijie <13522335863@163.com>
Co-authored-by: hsm-lv <80095014+hsm-lv@users.noreply.github.com>
Co-authored-by: sansiro <sansiro@sansiro.me>
Co-authored-by: HongYang <33488114+hy993658052@users.noreply.github.com>
Co-authored-by: hongyang03 <hongyang03@baidu.com>
Co-authored-by: sarding <37691952+sarding@users.noreply.github.com>
Co-authored-by: sarding <hongfuquan@baidu.com>
Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com>
Co-authored-by: 徐佳豪 <53201551+blue-squirrel@users.noreply.github.com>
Co-authored-by: xujiahao01 <xujiahao01@baidu.com>
Co-authored-by: 2betop <2betop.cn@gmail.com>
Co-authored-by: zzy1415447829 <49521093+zzy1415447829@users.noreply.github.com>
Co-authored-by: zhangzheyu02 <zhangzheyu02@baidu.com>
Co-authored-by: lengshengren <379306634@qq.com>
Co-authored-by: srleng <srleng@gaojihealth.com>
Co-authored-by: pzzhai <48534104+pzzhai@users.noreply.github.com>
Co-authored-by: lurunze1226 <lurunze1226@foxmail.com>
Co-authored-by: ”jiatianqi“ <”jiatianqi@baidu.com“>
Co-authored-by: Ma ke <33743617+jiatianqi@users.noreply.github.com>
Co-authored-by: 龙少 <1769057083@qq.com>
Co-authored-by: zhangxulong <zhangxulong@baidu.com>
Co-authored-by: yangwei9012 <yangwei9012@163.com>
Co-authored-by: Viki <53367348+Vikiboss@users.noreply.github.com>
Co-authored-by: qianxiaofendou <stianle@163.com>
Co-authored-by: Yuan Zhang <81345419+YuanZzhang@users.noreply.github.com>
Co-authored-by: wanglinfang2014 <w.l.fang@foxmail.com>
Co-authored-by: wanglinfang <wanglinfang@baidu.com>

* styles:主题样式走查 (#5214)

* feat: 主题变量修改 (#5228)

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* styles: 新版主题兼容antd (#5229)

* feat: AntD主题对齐

* amis4.0样式走查2期修改

* amis4.0二次走查修改变量

* feat: 主题对齐 (#5252)

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* feat: 边框变量修改 (#5257)

* feat: 主题对齐

* feat: 边框变量修改

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* style:组件4.0 style修改 (#5234)

* style:组件4.0 style修改

* style:alert组件变量修改

Co-authored-by: xujiahao01 <xujiahao01@baidu.com>

* New theme (#5276)

* feat: 主题对齐

* feat: 边框变量修改

* feat: 主题样式对齐

* feat: button样式修改

* feat: nest pading修改

* feat: nest pading修改

Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>

* styles: 主题问题修复 (#5279)

* styles: 新版主题样式修改 (#5293)

* style:组件主题变量修改 (#5294)

* style:组件主题变量修改

* style:wizard&drawer等变量修改

* 常量用变量替换

Co-authored-by: xujiahao01 <xujiahao01@baidu.com>

* New theme update (#5452)

* feat:主题变量修改

* fix:修改

Co-authored-by: hongyang03 <hongyang03@baidu.com>

* fix:修复图标选择css变量

* fix:button enhance类型样式修改

* amis-saas-2569 主题bugfix

* style:对象生成图标 对齐高度

* feat:collapse&inputTable&alert2&Avatar接入自定义图标

* style:人员选择组件背景色主题化

* test:更新快照

* test:更新快照

* test:更新快照

* test:更新快照

Co-authored-by: RUNZE LU <36724300+lurunze1226@users.noreply.github.com>
Co-authored-by: liuzedong02 <liuzedong02@baidu.com>
Co-authored-by: HongYang <33488114+hy993658052@users.noreply.github.com>
Co-authored-by: hongyang03 <hongyang03@baidu.com>
Co-authored-by: sansiro <sansiro@sansiro.me>
Co-authored-by: qiaoganggang <43558337+qiaogg@users.noreply.github.com>
Co-authored-by: qiaoganggang <qiaoganggang@baidu.com>
Co-authored-by: zhangzheyu02 <zhangzheyu02@baidu.com>
Co-authored-by: zzy1415447829 <49521093+zzy1415447829@users.noreply.github.com>
Co-authored-by: meerkat <kit_hack@outlook.com>
Co-authored-by: wuduoyi <wuduoyi@baidu.com>
Co-authored-by: RickCole <rickcole21@outlook.com>
Co-authored-by: Allen <yupeng.fe@qq.com>
Co-authored-by: pianruijie <13522335863@163.com>
Co-authored-by: hsm-lv <80095014+hsm-lv@users.noreply.github.com>
Co-authored-by: sarding <37691952+sarding@users.noreply.github.com>
Co-authored-by: sarding <hongfuquan@baidu.com>
Co-authored-by: 徐佳豪 <53201551+blue-squirrel@users.noreply.github.com>
Co-authored-by: xujiahao01 <xujiahao01@baidu.com>
Co-authored-by: 2betop <2betop.cn@gmail.com>
Co-authored-by: lengshengren <379306634@qq.com>
Co-authored-by: srleng <srleng@gaojihealth.com>
Co-authored-by: pzzhai <48534104+pzzhai@users.noreply.github.com>
Co-authored-by: lurunze1226 <lurunze1226@foxmail.com>
Co-authored-by: ”jiatianqi“ <”jiatianqi@baidu.com“>
Co-authored-by: Ma ke <33743617+jiatianqi@users.noreply.github.com>
Co-authored-by: 龙少 <1769057083@qq.com>
Co-authored-by: zhangxulong <zhangxulong@baidu.com>
Co-authored-by: yangwei9012 <yangwei9012@163.com>
Co-authored-by: Viki <53367348+Vikiboss@users.noreply.github.com>
Co-authored-by: qianxiaofendou <stianle@163.com>
Co-authored-by: Yuan Zhang <81345419+YuanZzhang@users.noreply.github.com>
Co-authored-by: wanglinfang2014 <w.l.fang@foxmail.com>
Co-authored-by: wanglinfang <wanglinfang@baidu.com>
Co-authored-by: 徐佳豪 <1440054388@qq.com>
2022-10-19 10:38:52 +08:00

583 lines
16 KiB
SCSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 媒体查询最小阈值
@mixin media-breakpoint-up($name, $breakpoints: $breakpoints) {
$min: breakpoint-min($name, $breakpoints);
@if $min {
@media (min-width: $min) {
@content;
}
} @else {
@content;
}
}
//媒体查询最大阈值
@mixin media-breakpoint-down($name, $breakpoints: $breakpoints) {
$max: breakpoint-max($name, $breakpoints);
@if $max {
@media (max-width: $max) {
@content;
}
} @else {
@content;
}
}
//媒体查询中间阈值
@mixin media-breakpoint-between($min, $max, $breakpoints: $breakpoints) {
$min: breakpoint-min($min, $breakpoints);
$max: breakpoint-max($max, $breakpoints);
@media (min-width: $min) and (max-width: $max) {
@content;
}
}
@mixin media-device($name, $devices: $devices) {
$n: map-get($devices, $name);
@media #{$n} {
@content;
}
}
@mixin clearfix() {
&::before,
&::after {
display: table;
content: '';
}
&::after {
clear: both;
}
}
// @deprecated 不建议用了
@mixin color-schema($bg-color: #555, $percent: 15%, $sat-percent: 100%) {
background: saturate(darken($bg-color, $percent), $sat-percent);
}
// @deprecated 不建议用了
@mixin color-schema-lt($bg-color: #555, $percent: 15%, $sat-percent: 100%) {
background: desaturate(lighten($bg-color, $percent), $sat-percent);
}
// @deprecated 不建议用了
@mixin color-variant(
$bg-color: #555,
$lt-percent: 10%,
$lter-percent: 15%,
$dk-percent: 10%,
$dker-percent: 15%
) {
background-color: $bg-color;
&.lt,
& .lt {
@include color-schema-lt($bg-color, $lt-percent, 2.5%);
}
&.lter,
& .lter {
@include color-schema-lt($bg-color, $lter-percent, 5%);
}
&.dk,
& .dk {
@include color-schema($bg-color, $dk-percent, 2.5%);
}
&.dker,
& .dker {
@include color-schema($bg-color, $dker-percent, 5%);
}
&.bg,
& .bg {
background-color: $bg-color;
}
}
// @deprecated 不建议用了
@mixin font-variant($bg-color) {
$font-color: desaturate(lighten($bg-color, 40%), 10%);
$link-color: desaturate(lighten($bg-color, 50%), 10%);
$hover-color: #fff;
color: $font-color;
& a,
& .#{$ns}Button--link {
color: $link-color;
&:hover {
color: $hover-color;
}
}
& .open > a {
&,
&:hover,
&:focus {
color: $hover-color;
}
}
& .text-muted {
color: darken($text-color, 10%) !important;
}
& .text-lt {
color: lighten($text-color, 25%) !important;
}
// &.auto,
// & .auto {
// & .list-group-item {
// border-color: darken($bg-color, 5%) !important;
// background: transparent;
// &:hover,
// &:focus,
// &:active,
// &.active {
// @include color-schema($bg-color, 5%, 2.5% !important);
// }
// }
// }
}
// @deprecated 不建议用了
@mixin text-wariant($bg-color, $name) {
a.bg-#{'' + $name}:hover {
background: darken($bg-color, 5%);
}
a.text-#{'' + $name}:hover {
color: darken($bg-color, 5%);
}
.text-#{'' + $name} {
color: $bg-color;
}
.text-#{'' + $name}-lt {
color: darken($bg-color, 5%);
}
.text-#{'' + $name}-lter {
color: darken($bg-color, 10%);
}
.text-#{'' + $name}-dk {
color: darken($bg-color, 5%);
}
.text-#{'' + $name}-dker {
color: darken($bg-color, 10%);
}
}
@mixin hover {
&:hover {
@content;
}
}
@mixin focus {
&:focus {
@content;
}
}
@mixin hover-focus {
&:hover:focus {
@content;
}
}
@mixin hover-active {
&:hover:active {
@content;
}
}
@mixin button-size(
$font-size: var(--button-size-default-font-size),
$line-height: var(--button-size-default-font-lineHeight),
$border-radius-top-right: var(--button-size-default-top-right-border-radius),
$border-radius-top-left: var(--button-size-default-top-left-border-radius),
$border-radius-bottom-right:
var(--button-size-default-bottom-right-border-radius),
$border-radius-bottom-left:
var(--button-size-default-bottom-left-border-radius),
$height: var(--button-size-default-height),
$paddingTop: var(--button-size-default-paddingTop),
$paddingBottom: var(--button-size-default-paddingBottom),
$paddingLeft: var(--button-size-default-paddingLeft),
$paddingRight: var(--button-size-default-paddingRight),
$marginTop: var(--button-size-default-marginTop),
$marginBottom: var(--button-size-default-marginBottom),
$marginLeft: var(--button-size-default-marginLeft),
$marginRight: var(--button-size-default-marginRight),
$minWidth: var(--button-size-default-minWidth),
$iconSize: var(--button-size-default-icon-size),
$iconMargin: var(--button-size-default-icon-margin)
) {
font-size: $font-size;
line-height: $line-height;
border-radius: $border-radius-top-right $border-radius-top-left
$border-radius-bottom-right $border-radius-bottom-left;
height: $height;
padding: $paddingTop $paddingRight $paddingBottom $paddingLeft;
margin: $marginTop $marginRight $marginBottom $marginLeft;
.#{$ns}Button-icon:first-child:not(:last-child):not(.pull-right),
> svg.icon:not(:last-child):not(.pull-right),
> .pull-left {
margin-right: $iconMargin;
font-size: $iconSize;
}
.#{$ns}Button-icon:last-child:not(:first-child):not(.pull-left),
> .pull-right {
font-size: $iconSize;
margin-left: $iconMargin;
}
.#{$ns}Button--loading:first-child:not(:last-child):not(.pull-right),
> svg.icon:not(:last-child):not(.pull-right),
> .pull-left {
font-size: $iconSize;
margin-right: $iconMargin;
}
.#{$ns}Button--loading:last-child:not(:first-child):not(.pull-left),
> .pull-right {
font-size: $iconSize;
margin-left: $iconMargin;
}
// img 需要加一下高度限制
img.#{$ns}Button-icon {
height: $iconSize;
vertical-align: middle;
}
}
@mixin button-loading-icon() {
transition: --Button-transition;
svg {
@include animation-svg(var(--Button-animation-spin));
}
}
@mixin animation-svg($animation) {
animation: $animation;
}
@mixin button-variant(
// 常规
$bg-color: var(--button-default-default-bg-color),
$font-color: var(--button-default-default-font-color),
$border-color-top: var(--button-default-default-top-border-color),
$border-color-right: var(--button-default-default-right-border-color),
$border-color-bottom: var(--button-default-default-bottom-border-color),
$border-color-left: var(--button-default-default-left-border-color),
$border-width-top: var(--button-default-default-top-border-width),
$border-width-right: var(--button-default-default-right-border-width),
$border-width-bottom: var(--button-default-default-bottom-border-width),
$border-width-left: var(--button-default-default-left-border-width),
$border-style-top: var(--button-default-default-top-border-style),
$border-style-right: var(--button-default-default-right-border-style),
$border-style-bottom: var(--button-default-default-bottom-border-style),
$border-style-left: var(--button-default-default-left-border-style),
$shadow: var(--button-default-default-shadow),
// 悬浮
$hover-bg-color: var(--button-default-hover-bg-color),
$hover-font-color: var(--button-default-hover-font-color),
$hover-border-color-top: var(--button-default-hover-top-border-color),
$hover-border-color-right: var(--button-default-hover-right-border-color),
$hover-border-color-bottom: var(--button-default-hover-bottom-border-color),
$hover-border-color-left: var(--button-default-hover-left-border-color),
$hover-border-width-top: var(--button-default-hover-top-border-width),
$hover-border-width-right: var(--button-default-hover-right-border-width),
$hover-border-width-bottom: var(--button-default-hover-bottom-border-width),
$hover-border-width-left: var(--button-default-hover-left-border-width),
$hover-border-style-top: var(--button-default-hover-top-border-style),
$hover-border-style-right: var(--button-default-hover-right-border-style),
$hover-border-style-bottom: var(--button-default-hover-bottom-border-style),
$hover-border-style-left: var(--button-default-hover-left-border-style),
$hover-shadow: var(--button-default-hover-shadow),
// 点击
$active-bg-color: var(--button-default-active-bg-color),
$active-font-color: var(--button-default-active-font-color),
$active-border-color-top: var(--button-default-active-top-border-color),
$active-border-color-right: var(--button-default-active-right-border-color),
$active-border-color-bottom: var(--button-default-active-bottom-border-color),
$active-border-color-left: var(--button-default-active-left-border-color),
$active-border-width-top: var(--button-default-active-top-border-width),
$active-border-width-right: var(--button-default-active-right-border-width),
$active-border-width-bottom: var(--button-default-active-bottom-border-width),
$active-border-width-left: var(--button-default-active-left-border-width),
$active-border-style-top: var(--button-default-active-top-border-style),
$active-border-style-right: var(--button-default-active-right-border-style),
$active-border-style-bottom: var(--button-default-active-bottom-border-style),
$active-border-style-left: var(--button-default-active-left-border-style),
$active-shadow: var(--button-default-active-shadow),
// 禁用
$disabled-bg-color: var(--button-default-disabled-bg-color),
$disabled-font-color: var(--button-default-disabled-font-color),
$disabled-border-color-top: var(--button-default-disabled-top-border-color),
$disabled-border-color-right:
var(--button-default-disabled-right-border-color),
$disabled-border-color-bottom:
var(--button-default-disabled-bottom-border-color),
$disabled-border-color-left: var(--button-default-disabled-left-border-color),
$disabled-border-width-top: var(--button-default-disabled-top-border-width),
$disabled-border-width-right:
var(--button-default-disabled-right-border-width),
$disabled-border-width-bottom:
var(--button-default-disabled-bottom-border-width),
$disabled-border-width-left: var(--button-default-disabled-left-border-width),
$disabled-border-style-top: var(--button-default-disabled-top-border-style),
$disabled-border-style-right:
var(--button-default-disabled-right-border-style),
$disabled-border-style-bottom:
var(--button-default-disabled-bottom-border-style),
$disabled-border-style-left: var(--button-default-disabled-left-border-style),
$disabled-shadow: var(--button-default-disabled-shadow)
) {
color: $font-color;
background: $bg-color;
border-color: $border-color-top $border-color-right $border-color-bottom
$border-color-left;
border-width: $border-width-top $border-width-right $border-width-bottom
$border-width-left;
border-style: $border-style-top $border-style-right $border-style-bottom
$border-style-left;
box-shadow: $shadow;
// text-shadow: var(--Button-textShadow);
&:not(:disabled):not(.is-disabled) {
@include hover {
color: $hover-font-color;
background: $hover-bg-color;
border-color: $hover-border-color-top $hover-border-color-right
$hover-border-color-bottom $hover-border-color-left;
border-width: $hover-border-width-top $hover-border-width-right
$hover-border-width-bottom $hover-border-width-left;
border-style: $hover-border-style-top $hover-border-style-right
$hover-border-style-bottom $hover-border-style-left;
box-shadow: $hover-shadow;
}
@include hover-active {
color: $active-font-color;
background: $active-bg-color;
border-color: $active-border-color-top $active-border-color-right
$active-border-color-bottom $active-border-color-left;
border-width: $active-border-width-top $active-border-width-right
$active-border-width-bottom $active-border-width-left;
border-style: $active-border-style-top $active-border-style-right
$active-border-style-bottom $active-border-style-left;
box-shadow: $active-shadow;
}
}
&:disabled,
&.is-disabled {
color: $disabled-font-color;
background: $disabled-bg-color;
border-color: $disabled-border-color-top $disabled-border-color-right
$disabled-border-color-bottom $disabled-border-color-left;
border-width: $disabled-border-width-top $disabled-border-width-right
$disabled-border-width-bottom $disabled-border-width-left;
border-style: $disabled-border-style-top $disabled-border-style-right
$disabled-border-style-bottom $disabled-border-style-left;
box-shadow: $disabled-shadow;
}
@include hover-focus {
box-shadow: var(--Button-boxShadow);
}
}
@mixin input-clear {
padding: var(--Form-input-clearBtn-padding);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
margin-left: auto;
text-decoration: none;
svg {
fill: var(--Form-input-clearBtn-color);
top: 0;
width: var(--Form-input-clearBtn-size);
height: var(--Form-input-clearBtn-size);
}
&:hover svg {
fill: var(--Form-input-clearBtn-color-onHover);
}
&:active svg {
fill: var(--Form-input-clearBtn-color-onActive);
}
}
@mixin input-input {
display: flex;
background: var(--Form-input-bg);
border: var(--Form-input-borderWidth) solid var(--Form-input-borderColor);
border-radius: var(--Form-input-borderRadius);
// height: var(--Form-input-height);
line-height: var(--Form-input-lineHeight);
padding: var(--Form-input-paddingY) var(--Form-input-paddingX);
font-size: var(--Form-input-fontSize);
flex-wrap: wrap;
justify-content: flex-start;
input {
flex-basis: px2rem(30px);
flex-grow: 1;
outline: none;
background: transparent;
border: none;
color: var(--Form-input-color);
width: 100%;
height: calc(var(--Form-input-lineHeight) * var(--Form-input-fontSize));
&::placeholder {
color: var(--Form-input-placeholderColor);
user-select: none;
}
}
&:hover {
border-color: var(--Form-input-onFocused-borderColor);
}
}
@mixin input-border {
&--borderHalf {
border-left-color: transparent !important;
border-right-color: transparent !important;
border-top-color: transparent !important;
}
&--borderNone {
border-color: transparent !important;
}
}
@mixin input-text {
position: relative;
max-width: 100%;
&.is-inline {
display: inline-block;
width: var(--Form-control-widthBase);
}
&-input {
@include input-input();
@include input-border();
}
&.is-error > &-input {
border-color: var(--Form-input-onError-borderColor);
background: var(--Form-input-onError-bg);
transition: all var(--animation-duration);
}
&.is-focused > &-input {
border-color: var(--Form-input-onFocused-borderColor);
box-shadow: var(--Form-input-boxShadow);
background: var(--Form-input-onFocused-bg);
transition: all var(--animation-duration);
}
&.is-error.is-focused > &-input {
border-color: var(--Form-input-onError-borderColor);
}
&.is-disabled > &-input {
color: var(--text--muted-color);
background: var(--Form-input-onDisabled-bg);
border-color: var(--Form-input-onDisabled-borderColor);
transition: all var(--animation-duration);
& > input {
color: var(--text--muted-color);
}
}
&-spinner {
line-height: calc(
var(--Form-input-lineHeight) * var(--Form-input-fontSize)
);
}
&-clear {
@include input-clear();
}
&-revealPassword {
cursor: pointer;
color: var(--text--muted-color);
}
// 需要能撑开
@include media-breakpoint-up(sm) {
&.#{$ns}Form-control--sizeXs > &-input,
&.#{$ns}Form-control--sizeSm > &-input,
&.#{$ns}Form-control--sizeMd > &-input,
&.#{$ns}Form-control--sizeLg > &-input {
min-width: 100%;
display: inline-flex;
}
}
}
@mixin checkboxes-placeholder {
height: var(--Form-input-height);
line-height: var(--Form-input-lineHeight);
font-size: var(--Form-input-fontSize);
padding: calc(
(
var(--Form-input-height) - var(--Form-input-lineHeight) *
var(--Form-input-fontSize)
) / 2
)
var(--gap-sm);
color: var(--text--muted-color);
}
@mixin label-variant($color) {
background: $color;
// todo不支持了
// &[href] {
// &:hover,
// &:focus {
// background: darken($color, 10%);
// }
// }
}
@mixin icon-color {
color: var(--icon-color);
&:hover {
color: var(--icon-onHover-color);
}
}
@mixin truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}