{"id":20881711,"url":"https://github.com/huanz/mixins","last_synced_at":"2026-03-06T08:34:08.357Z","repository":{"id":57298617,"uuid":"67672500","full_name":"huanz/mixins","owner":"huanz","description":"sass mixins","archived":false,"fork":false,"pushed_at":"2018-12-01T17:32:12.000Z","size":33,"stargazers_count":135,"open_issues_count":1,"forks_count":37,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-13T12:12:35.719Z","etag":null,"topics":["balloon","mixins","onepx","sass","scss"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huanz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-08T05:46:36.000Z","updated_at":"2025-07-28T17:15:37.000Z","dependencies_parsed_at":"2022-08-26T18:02:29.455Z","dependency_job_id":null,"html_url":"https://github.com/huanz/mixins","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huanz/mixins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanz%2Fmixins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanz%2Fmixins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanz%2Fmixins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanz%2Fmixins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huanz","download_url":"https://codeload.github.com/huanz/mixins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huanz%2Fmixins/sbom","scorecard":{"id":471747,"data":{"date":"2025-08-11","repo":{"name":"github.com/huanz/mixins","commit":"bf3956fb27937730a2336a17694a69d5adc7e276"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T14:04:49.865Z","repository_id":57298617,"created_at":"2025-08-19T14:04:49.865Z","updated_at":"2025-08-19T14:04:49.865Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30167963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["balloon","mixins","onepx","sass","scss"],"created_at":"2024-11-18T07:26:04.089Z","updated_at":"2026-03-06T08:34:08.329Z","avatar_url":"https://github.com/huanz.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mixins-sass [![mixins-sass](https://img.shields.io/npm/v/mixins-sass.svg?style=flat-square)](https://www.npmjs.com/package/mixins-sass) [![mixins-sass](https://img.shields.io/npm/dt/mixins-sass.svg)](https://www.npmjs.com/package/mixins-sass)\n\nsass mixins，require `Sass ~\u003e 3.3.0`\n\n**utility**\n\n* [`prefix`](#prefix)\n* [`clearfix`](#clearfix)\n* [`float`](#float)\n* [`text-overflow`](#text-overflow)\n* [`animation`](#animation)\n* [`placeholder`](#placeholder)\n* [`rem`](#rem)\n* [`opacity`](#opacity)\n* [`arrow`](#arrow)\n* [`triangle`](#triangle)\n* [`center`](#center)\n* [`media`](#media)\n* [`box-sizing`](#box-sizing)\n* [`touch-scroll`](#touch-scroll)\n* [`font`](#font)\n* [`onepx`](#onepx)\n* [`balloon`](#balloon)\n* [`side-line`](#side-line)\n\n**functions**\n\n*string*\n\n* [`str-split`](#str-split)\n* [`str-repeat`](#str-repeat)\n* [`str-replace`](#str-replace)\n\n*list*\n\n* [`first`](#first)\n* [`last`](#last)\n* [`prepend`](#prepend)\n* [`insert-nth`](#insert-nth)\n* [`replace`](#replace)\n* [`replace-nth`](#replace-nth)\n* [`remove`](#remove)\n* [`remove-nth`](#remove-nth)\n* [`slice`](#slice)\n* [`to-string`](#to-string)\n* [`shift`](#shift)\n* [`contain`](#contain)\n\n## usage\n\n```shell\nnpm i mixins-sass --save\n```\n\n```scss\n@import \"./node_modules/mixins-sass/src/mixins\";\n```\n\n## utility\n\n### `prefix`\n\n```scss\n/**\n * @param $map       css列表\n * @param $vendors   浏览器前缀，默认：webkit moz ms o\n */\n@mixin prefix($map, $vendors: webkit moz ms o)\n\n.test {\n    @include prefix((transliton: all 0.5s ease-out), webkit);\n}\n```\n\n### clearfix\n\n```scss\n@include clearfix;\n```\n\n### float\n\n```scss\n@include float(left);\n```\n\n### text-overflow\n\n文字超出显示省略号，支持多行\n\n```scss\n/**\n * @param $line       超出显示省略号的行数，默认：1\n * @param $substract  为预留区域百分比%，默认：0\n */\n@mixin text-overflow($line: 1, $substract: 0);\n```\n\n### animation\n\n```scss\n@include animation(slideUp 900ms ease both) {\n    0% {\n        transform: translate3d(0, -200px, 0);\n    }\n    100% {\n        transform: translate3d(0, 0, 0);\n    }\n}\n```\n\n\n### placeholder\n\n```scss\n// scss\n@include placeholder() {\n\t...\n}\n// css\n::-webkit-input-placeholder {\n    ...\n}\n::-moz-placeholder {\n    ...\n}\n:-ms-input-placeholder {\n   ...\n}\n```\n\n### rem\n\npx转rem\n\n```scss\n/**\n * @param $property       css属性\n * @param $values         css属性值\n * @param $support-ie     是否对不支持rem的浏览器使用px\n * @param $base           基准字体大小，如果不传会搜索全局变量 $base-font，如果没有默认为 16px\n */\n@mixin rem($property, $values, $support-ie: true, $base: null)\n\n@include rem('padding', '10px 5px 5px 10px', true, '16px');\n```\n\n### opacity\n\n兼容ie的透明度\n\n### arrow\n\n生成上下左右的小箭头：[http://lugolabs.com/caret](http://lugolabs.com/caret)\n\n```scss\n/**\n * @param $width\n * @param $border-width\n * @param $direction: top bottom left right\n * @param $background-color\n * @param $position 默认relative\n */\n@mixin arrow($width, $border-width, $direction, $color, $background-color, $position: relative)\n\n@include arrow(10px, 1px, 'bottom', '#00f', '#fff');\n```\n\n### triangle\n\n三角形生成\n\n```scss\n/**\n * @param $width\n * @param $height\n * @param $color\n * @param $direction: top bottom left right\n */\n@mixin triangle($width, $height, $color: #000, $direction: bottom)\n\n/**\n * svg背景图生成三角形\n */\n@mixin svg-triangle($width, $height, $color: #000, $direction: bottom)\n\n@include triangle(10px, 5px);\n```\n\n### center\n\n居中\n\n```scss\n/**\n * @param $direction: horizontal vertical both,  default: both\n */\n@include center;\n```\n\n### media\n\n媒体查询相关\n\n```scss\n/**\n * @param $min   min-width\n * @param $max   max-width\n */\n@mixin screen($min, $max)\n@mixin max-screen($width)\n@mixin min-screen($width)\n@mixin hidpi($ratio: 1.3)\n\n/**\n * @param $filename\n * @param $retina-filename   多个或者一个\n * @param $ratio             多个或者一个\n * @param $background-size\n */\n@mixin retina-image($filename, $retina-filename, $ratio: 1.3, $background-size: 100%)\n@mixin iphone6($orientation: all)\n@mixin iphone6plus($orientation: all)\n@mixin iphone5($orientation: all)\n@mixin iphone4($orientation: all)\n@mixin ipad($orientation: all)\n@mixin ipad-mini($orientation: all)\n@mixin ipad-retina($orientation: all)\n\n@include retina-image(test.png, test@2.png test@3.png, 2 3);\n```\n\n### box-sizing\n\n```scss\nhtml {\n    @include box-sizing(border-box);\n}\n```\n\n### touch-scroll\n\n```scss\nbody {\n    @include touch-scroll;\n}\n// css\nbody {\n    -webkit-overflow-scrolling: touch;\n    overflow-scrolling: touch;\n}\n```\n\n### font\n\n中文字体解决方案，来自[https://github.com/zenozeng/fonts.css](https://github.com/zenozeng/fonts.css)，有`font-hei`、`font-kai`、`font-song`、`font-fang-song`。\n\n```scss\nbody {\n    @include font-hei;\n}\n```\n\n### onepx\n\n移动端`1像素`方案，通过`background-image`渐变色实现\n\n```scss\n/**\n * @param $color\n * @param $direction: top bottom left right vertical all,  default: all\n * @param $pseudo: after before, default: after\n */\n.border-l {\n    @include onepx(#eee, left);\n}\n```\n\n**onepx-scale**\n\n通过`transform`实现，支持圆角\n\n```scss\n/**\n * @param $color\n * @param $direction: top bottom left right vertical all radius,  default: all\n * @param $pseudo: after before, default: after\n * @param $radius default: 1px\n */\n.border-r {\n    @include onepx-scale(#eee, radius, after, 2px);\n}\n```\n\n### balloon\n\n气泡提示，来自：[balloon.css](http://kazzkiq.github.io/balloon.css/)\n\n```scss\n/**\n * @param $direction:            top bottom left right\n * @param $bg                    气泡提示背景颜色\n * @param $trangle-width         气泡小三角形宽度\n * @param $trangle-height        气泡小三角形高度\n * @param $color                 气泡文字颜色\n * @param $font                  气泡文字大小\n */\n@mixin balloon($direction, $bg, $trangle-width: 18px, $trangle-height: 6px, $color: #fff, $font: 12px)\n\n.balloon {\n    @include balloon(top, #000);\n}\n```\n\n```html\n\u003cspan class=\"balloon\" data-balloon=\"Whats up!\"\u003eHover me!\u003c/span\u003e\n```\n\n### side-line\n\n线中间夹文字效果\n\n[http://codepen.io/anon/pen/XjNEAR](http://codepen.io/anon/pen/XjNEAR)\n\n```scss\n/**\n * @param $height  线高  default: 1px\n * @param $space   线距离文字两边的距离 default: 0.5em\n * @param $color   线颜色 default: inherit\n * @param $style   border-style default: solid\n * @param $adjust  线距离底部的距离，默认垂直居中 default: false\n * @param $double  是否需要两条线\n */\n@mixin side-line($height: 1px, $space: 0.5em, $color: inherit, $style: solid, $adjust: false, $double: false)\n\n.side-line {\n    @include side-line;\n}\n```\n\n## functions\n\n**string**\n\n### str-split\n\n字符串分隔\n\n```scss\n@function str-split($string, $delimiter: \" \")\n```\n\n### str-repeat\n\n字符串重复\n\n```scss\n@function str-repeat($string, $times)\n```\n\n### str-replace\n\n字符串替换\n\n```scss\n@function str-replace($string, $search, $replace: \"\")\n```\n\n**list** \n\n### first\n\n返回列表第一项\n\n```scss\n@function first($list)\n```\n\n### last\n\n返回列表最后一项\n\n```scss\n@function last($list)\n```\n\n### prepend\n\n向列表前面插入一个\n\n```scss\n@function prepend($list, $value)\n```\n\n### insert-nth\n\n向列表某个位置插入\n\n```scss\n@function insert-nth($list, $index, $value)\n```\n\n### replace\n\n替换列表的某个元素 `$recursive` 是否全部替换\n\n```scss\n@function replace($list, $old-value, $new-value, $recursive: false)\n```\n\n### replace-nth\n\n替换列表某个位置的元素\n\n```scss\n@function replace-nth($list, $index, $value)\n```\n\n### remove\n\n删除列表某个元素 `$recursive` 是否删除所有\n\n```scss\n@function remove($list, $value, $recursive: false)\n```\n\n### remove-nth\n\n删除列表指定位置元素\n\n```scss\n@function remove-nth($list, $index)\n```\n\n### slice\n\n截取列表中的一部分\n\n```scss\n@function slice($list, $start: 1, $end: length($list))\n```\n\n### to-string\n\n列表变成字符串，`$glue`为连接符，`$is-nested`是否是嵌套的列表\n\n```scss\n@function to-string($list, $glue: '', $is-nested: false)\n```\n\n### shift\n\n将列表部分元素前置\n\n```scss\n@function shift($list, $index: 1)\n```\n\n### contain\n\n列表是存在某个值\n\n```\n@function contain($list, $value)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuanz%2Fmixins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuanz%2Fmixins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuanz%2Fmixins/lists"}