跳至内容
sdvcrx's wiki
用户工具
登录
站点工具
搜索
工具
显示页面
过去修订
Export to Markdown
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您的足迹:
frontend:scss
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== SCSS / SASS ====== {{tag>frontend css}} ===== Tricks ===== ==== 固定表格宽度 ==== 用此mixins可按设定宽度固定表格的宽度,具体布局原理详见[[frontend:html#Table|表格布局原理]] <code css _table-width.scss> /** * Fix table width * * Usage: * ```scss * .table { * @include table-width(60px 120px 60px initial 30em 50rem); * } * ``` */ @mixin table-width($table-cell-width) { @for $i from 1 through length($table-cell-width) { th:nth-child(#{length($table-cell-width)}n+#{$i}) { width: nth($table-cell-width, $i); } } } </code> ==== AutoPrefix ==== 以下是为一些不会被[[https://github.com/postcss/autoprefixer|autoprefixer]]覆盖的CSS属性[(cite:>[[https://github.com/postcss/autoprefixer/issues/167|不是web标准属性,不会被autoprefix]])]自动添加浏览器前缀的mixin: <code css _prefix.scss> /* autoprefixer will not auto prefix user-select */ @mixin user-select($select) { -webkit-user-select: $select; -moz-user-select: $select; -ms-user-select: $select; /* IE10+ */ user-select: $select; } @mixin placeholder($color) { /* Firefox */ &::-moz-placeholder { color: $color; opacity: 1; /* Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526 */ } &:-ms-input-placeholder { color: $color; } /* Internet Explorer 10+ */ &::-webkit-input-placeholder { color: $color; } /* Safari and Chrome */ } </code> ==== CSS实现折行 ==== From [[https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/mixins/_text-overflow.scss|Bootstrap sass]] <code css text-overflow.scss> /* * Text overflow * Requires inline-block or block for proper styling */ @mixin text-overflow() { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } </code>
frontend/scss.txt
· 最后更改: 2023/12/03 10:24 由
127.0.0.1
页面工具
显示页面
过去修订
反向链接
Export to Markdown
回到顶部