{"id":15297222,"url":"https://github.com/iruxu/csslab","last_synced_at":"2025-04-13T22:31:18.821Z","repository":{"id":19802574,"uuid":"23062510","full_name":"iRuxu/csslab","owner":"iRuxu","description":"用于快速进行页面重构的CSS函数库","archived":false,"fork":false,"pushed_at":"2022-08-27T09:10:40.000Z","size":3559,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-01T19:15:42.986Z","etag":null,"topics":["css","css3","csslab","frontend-web","iehack","less"],"latest_commit_sha":null,"homepage":"http://csslab.cc","language":"Less","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/iRuxu.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":"2014-08-18T07:30:21.000Z","updated_at":"2023-03-28T08:07:36.000Z","dependencies_parsed_at":"2022-08-25T21:40:49.906Z","dependency_job_id":null,"html_url":"https://github.com/iRuxu/csslab","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iRuxu%2Fcsslab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iRuxu%2Fcsslab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iRuxu%2Fcsslab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iRuxu%2Fcsslab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iRuxu","download_url":"https://codeload.github.com/iRuxu/csslab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219845375,"owners_count":16556447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["css","css3","csslab","frontend-web","iehack","less"],"created_at":"2024-09-30T19:15:43.674Z","updated_at":"2024-10-15T03:20:59.489Z","avatar_url":"https://github.com/iRuxu.png","language":"Less","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CssLab \n###### Homepage: \u003chttp://csslab.cc\u003e\n-------------------------------\n\n## 目录\n+ [简介说明](#intro)\n+ [使用指南](#get-started)\n+ [参考文档](#documentation)\n+ [其它链接](#contribute)\n\n## \u003ca name=\"intro\"\u003e\u003c/a\u003e 简介说明\ncsslab是一个动态css依赖库，它由一些自定义函数组成，可快速书写一些常用的css片段并自动进行计算，同时提供一些IE6/7兼容hack和简写，以便能更快捷高效地完成网页重构工作。\n\n##### Example.1 常见片段\n例如，常见的让文本禁止换行，溢出的部分处理为显示“...”：\n```less\n.textline{\n    .nobreak;\n}\n\n//编译后输出为\n.textline{\n    white-space:nowrap;\n    word-wrap:normal;\n    word-break:keep-all;\n    text-overflow:ellipsis;\n    overflow:hidden;\n}\n```\n\n##### Example.2 自动计算\n例如，让一个已知尺寸的元素总是自动绝对居中定位：\n```less\n.fixwindow{\n    .size(400px,300px);\n    .ct(400px,300px);\n}\n\n//编译后输出为\n.fixwindow{\n    width:400px;\n    height:300px;\n    position:absolute;\n    left:50%;\n    top:50%;\n    margin-left:-200px;\n    margin-top:-150px;\n}\n```\n\n##### Example.3 动画调用\n传入参数指定动画的时间，并且只有调用该动画时生成对应keyframes，不会因需使用动画库中一个定义帧而要引入全部内容或繁琐地剪切粘贴：\n```less\n.animate-element{\n    .fadeIn(2s);\n}\n//编译后输出为\n//94900655为随机数\n.animate-element{\n  -webkit-animation-name: fadeIn_94900655;\n          animation-name: fadeIn_94900655;\n  -webkit-animation-duration: 2s;\n          animation-duration: 2s;\n  -webkit-animation-timing-function: ease-out;\n          animation-timing-function: ease-out;\n  -webkit-animation-fill-mode: backwards;\n          animation-fill-mode: backwards;\n}\n@keyframes fadeIn_94900655 {\n  0% {\n    opacity: 0;\n  }\n  100% {\n    opacity: 1;\n  }\n}\n```\n\n## \u003ca name=\"get-started\"\u003e\u003c/a\u003e 使用指南\n##### Step.1 安装支持环境\n安装nodejs，并使用npm安装less/sass；\n也可以使用[koala](http://koala-app.com/index-zh.html)等可视化编译器。\n同时建议安装autoprefixer插件，以生成相应浏览器前缀。\n\n##### Step.2 引入文件\n将文件下载至指定工作目录，通过正确的路径引入。\n```less\n//单独引入指定子函数库\n@import url('base.less');\n@import url('animation.less');\n```\n\n## \u003ca name=\"documentation\"\u003e\u003c/a\u003e 参考文档\n+ *[base](http://csslab.cc/index.html)*  - 基础函数库，常用的IE6-IE8各类HACK，快捷书写函数\n+ *[reset](http://csslab.cc/reset.html)* - 浏览器样式重置\n+ *[shape](http://csslab.cc/shape.html)* - 使用CSS绘制常用的图形\n+ *[animation](http://csslab.cc/animation.html)* - 基础动画库，提供常见的动画\n+ *[twinkle](http://csslab.cc/twinkle.html)* - 扩展动画库\n+ *base-fix* - 旧版base废弃函数（限芒果TV）（仅v3及v3版本以前）\n\n## \u003ca name=\"contribute\"\u003e\u003c/a\u003e 其它链接\n+ *[CSS笔记](http://iruxu.com/notebook)*\n+ *[LESS中文手册](http://less.bootcss.com/features/)*\n+ *[Koala](http://koala-app.com/index-zh.html)* （一款方便的可视化前端编译器）\n+ *[Silky](http://silky.wvv8oo.com)* （芒果TV使用的前端开发集成工具）\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firuxu%2Fcsslab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firuxu%2Fcsslab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firuxu%2Fcsslab/lists"}