Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
mixins-sass
Advanced tools
sass mixins,require Sass ~> 3.3.0
utility
prefix
clearfix
float
text-overflow
animation
placeholder
rem
opacity
arrow
triangle
center
media
box-sizing
touch-scroll
font
onepx
functions
string
list
npm i mixins-sass --save
prefix
// scss 默认前缀:webkit moz ms o
.test {
@include prefix((transliton: all 0.5s ease-out), webkit);
}
// css
.test {
-webkit-transliton: all 0.5s ease-out;
transliton: all 0.5s ease-out;
}
@include clearfix;
@include float(left);
文字超出显示省略号,支持多行,$substract
为预留区域百分比%
@mixin text-overflow($line: 1, $substract: 0);
@include animation(slideUp 900ms ease both) {
0% {
transform: translate3d(0, -200px, 0);
}
100% {
transform: translate3d(0, 0, 0);
}
}
// scss
@include placeholder() {
...
}
// css
::-webkit-input-placeholder {
...
}
::-moz-placeholder {
...
}
:-ms-input-placeholder {
...
}
px转rem
// @mixin rem($property, $values, $support-ie: true, $base: null)
// $support-ie不支持rem的浏览器使用px
// $base 如果未传,会搜索全局变量 $base-font,如果没有默认为 16px
@include rem('padding', '10px 5px 5px 10px', true, '16px');
兼容ie的透明度
生成上下左右的小箭头:http://lugolabs.com/caret
// @mixin arrow($width, $border-width, $direction, $color, $background-color, $position: relative)
// 箭头宽度 线宽 方向 颜色 背景颜色(一般和父级背景同色)
@include arrow(10px, 1px, 'bottom', '#00f', '#fff');
三角形生成
// @mixin triangle($width, $height, $color: #000, $direction: down)
@include triangle(10px, 5px);
居中
// horizontal,vertical,both
@include center(both);
媒体查询相关
// min-width max-width
@mixin screen($min, $max)
@mixin max-screen($width)
@mixin min-screen($width)
@mixin hidpi($ratio: 1.3)
@mixin retina-image($filename, $retina-filename, $ratio: 1.3, $background-size: 100%)
@mixin iphone6($orientation: all)
@mixin iphone6plus($orientation: all)
@mixin iphone5($orientation: all)
@mixin iphone4($orientation: all)
@mixin ipad($orientation: all)
@mixin ipad-mini($orientation: all)
@mixin ipad-retina($orientation: all)
@include retina-image(test.png, test@2.png test@3.png, 2 3);
html {
@include box-sizing(border-box);
}
body {
@include touch-scroll;
}
// css
body {
-webkit-overflow-scrolling: touch;
overflow-scrolling: touch;
}
中文字体解决方案,来自https://github.com/zenozeng/fonts.css,有font-hei
、font-kai
、font-song
、font-fang-song
。
body {
@include font-hei;
}
移动端1像素
方案
// $color $direction: top bottom left right vertical all(可不传,四周边框)
.border-l {
@include onepx(#eee, left);
}
string
字符串分隔
@function str-split($string, $delimiter: " ")
字符串重复
@function str-repeat($string, $times)
字符串替换
@function str-replace($string, $search, $replace: "")
list
返回列表第一项
@function first($list)
返回列表最后一项
@function last($list)
向列表前面插入一个
@function prepend($list, $value)
向列表某个位置插入
@function insert-nth($list, $index, $value)
替换列表的某个元素 $recursive
是否全部替换
@function replace($list, $old-value, $new-value, $recursive: false)
替换列表某个位置的元素
@function replace-nth($list, $index, $value)
删除列表某个元素 $recursive
是否删除所有
@function remove($list, $value, $recursive: false)
删除列表指定位置元素
@function remove-nth($list, $index)
截取列表中的一部分
@function slice($list, $start: 1, $end: length($list))
列表变成字符串,$glue
为连接符,$is-nested
是否是嵌套的列表
@function to-string($list, $glue: '', $is-nested: false)
将列表部分元素前置
@function shift($list, $index: 1)
列表是存在某个值
@function contain($list, $value)
FAQs
a sass mixins library
The npm package mixins-sass receives a total of 2 weekly downloads. As such, mixins-sass popularity was classified as not popular.
We found that mixins-sass demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.