├── .npmignore ├── README.md ├── book ├── gtoc.css ├── gtoc.js ├── gtoc.less ├── lesshat.less └── mod │ ├── content.js │ ├── elevator.js │ └── interaction.js ├── index.js ├── lesshat.less ├── npm-debug.log └── package.json /.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Deployed apps should consider commenting this line out: 24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 25 | node_modules 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GitBook Table Of Content Plugin 2 | ============== 3 | 4 | 为GitBook生成目录结构,效果如下: 5 | 6 | ![gtoc效果图](https://lh6.googleusercontent.com/-jsqrsB5Pu1o/VJLHr7s0J2I/AAAAAAAACNw/f3jcM5F4aVc/s800/gtoc%25E6%2588%25AA%25E5%259B%25BE.png) 7 | 8 | 9 | 10 | ### 使用方式 11 | 在`book.json`中添加如下配置: 12 | { 13 | "plugins": ["gtoc"] 14 | } 15 | 16 | 然后运行`gitbook install`即可。 17 | 18 | ### 功能 19 | - 抽取页面标题组成目录列表 20 | - 自动添加序号 21 | - 可隐藏GTOC 22 | - 回到顶部功能,可配置是否有“电梯”效果 23 | - 适配Gitbook的“Sepia”、“Night”主题 24 | - 抽离出配置项,提供 25 | 26 | ### 快捷键 27 | 【t】:收缩/展现目录 28 | 29 | 【h】:显示/隐藏目录 30 | 31 | ### 说明 32 | - 默认只抽取h2,h3标题 33 | - 默认进入页面就显示(后期会修改默认隐藏) 34 | 35 | 36 | ### TODO 37 | - 需要有本地存储功能,记忆上次用户阅读的位置,可配置此功能【2014.12.23】 38 | - 需要抽取出配置项【2014.12.23】 39 | - 适应不同主题下的样式(比如夜间模式等等)【20141219】 40 | - 添加滚动高显功能,电梯功能【20141219】 41 | - 功能的模块化【20141219】 42 | - 绑定快捷键't',用于toggle显示/隐藏【20141218】 43 | - 手柄hover状态时,需显示提示文字【20141218】 44 | - 添加“回到顶部”【20141218】 45 | - 配置:【20141218】 46 | + 抽取层级 47 | + 放在左边还是右边 48 | + 跟随还是放在开头(跟随的时候可以折叠,包含“回到顶部”按钮) 49 | 50 | 51 | ### 修改记录 52 | 53 | **2015.01.04** 54 | - 修复“初始化组件,内容太长也不会显示滚动条”的bug 55 | 56 | **2014.12.24** 57 | - 完成电梯功能 58 | - 解决ScrollTop的奇怪问题,“只有在Chrome打开控制台情况下'回到顶部'按钮才有有效”,这是因为当宽度大于1240时body-inner是固定高度的,而当宽度小于1240时,body-inner是变高度,book-body是固定高度的;原始代码只对book-body设置scrollTop动画,所以打开Chrome窗口的时候(意外地使得浏览器窗口小于1240)才有动画;已经修复。 59 | 60 | **2014.12.22** 61 | - 主题模式的匹配 62 | - "回到顶部"功能 63 | 64 | **2014.12.19** 65 | - 重构,模块化,抽离出content模块,专注目录dom字符串 66 | - 调整目录结构,使得能够出现垂直滚动条 67 | - 添加state-scroll,只有当窗口高度小于目录高度时候才显示滚动条 68 | 69 | **2014.12.18** 70 | - 使用$.guid给不同的标题赋Id 71 | - 使用tagName给不同层级标题赋值类名 72 | - 添加动画效果 -------------------------------------------------------------------------------- /book/gtoc.css: -------------------------------------------------------------------------------- 1 | /* 文字不换行 */ 2 | .no-breakline, 3 | .gitbook-table-of-contents .gtoc-level { 4 | white-space: nowrap; 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | } 8 | .no-breakline:hover { 9 | overflow: visible; 10 | } 11 | /* fixed垂直居中 */ 12 | .fixed-common { 13 | zoom: 1; 14 | filter: alpha(opacity=100); 15 | -webkit-opacity: 1; 16 | -moz-opacity: 1; 17 | opacity: 1; 18 | position: fixed; 19 | top: 50%; 20 | -webkit-transform: translate3d(0, -50%, 0); 21 | -moz-transform: translate3d(0, -50%, 0); 22 | -ms-transform: translate3d(0, -50%, 0); 23 | -o-transform: translate3d(0, -50%, 0); 24 | transform: translate3d(0, -50%, 0); 25 | -webkit-transition: 1s; 26 | -moz-transition: 1s; 27 | -o-transition: 1s; 28 | transition: 1s; 29 | } 30 | .state-min .fixed-common { 31 | -webkit-transform: translate3d(270px, -50%, 0); 32 | -moz-transform: translate3d(270px, -50%, 0); 33 | -ms-transform: translate3d(270px, -50%, 0); 34 | -o-transform: translate3d(270px, -50%, 0); 35 | transform: translate3d(270px, -50%, 0); 36 | } 37 | .state-hide .fixed-common { 38 | zoom: 1; 39 | filter: alpha(opacity=0); 40 | -webkit-opacity: 0; 41 | -moz-opacity: 0; 42 | opacity: 0; 43 | } 44 | .gitbook-table-of-contents { 45 | padding: 0 15px 15px 15px; 46 | background-color: #ffffff; 47 | right: 20px; 48 | border: 1px solid #c9caca; 49 | border-top: 5px solid #ea5414; 50 | width: 250px; 51 | z-index: 99; 52 | max-height: 100%; 53 | zoom: 1; 54 | filter: alpha(opacity=100); 55 | -webkit-opacity: 1; 56 | -moz-opacity: 1; 57 | opacity: 1; 58 | position: fixed; 59 | top: 50%; 60 | -webkit-transform: translate3d(0, -50%, 0); 61 | -moz-transform: translate3d(0, -50%, 0); 62 | -ms-transform: translate3d(0, -50%, 0); 63 | -o-transform: translate3d(0, -50%, 0); 64 | transform: translate3d(0, -50%, 0); 65 | -webkit-transition: 1s; 66 | -moz-transition: 1s; 67 | -o-transition: 1s; 68 | transition: 1s; 69 | } 70 | .color-theme-1 .gitbook-table-of-contents { 71 | background-color: #f7f1dc; 72 | } 73 | .color-theme-2 .gitbook-table-of-contents { 74 | background-color: #2b2b2b; 75 | } 76 | .state-scroll .gitbook-table-of-contents { 77 | overflow-y: scroll; 78 | } 79 | .state-min .gitbook-table-of-contents { 80 | -webkit-transform: translate3d(270px, -50%, 0); 81 | -moz-transform: translate3d(270px, -50%, 0); 82 | -ms-transform: translate3d(270px, -50%, 0); 83 | -o-transform: translate3d(270px, -50%, 0); 84 | transform: translate3d(270px, -50%, 0); 85 | } 86 | .state-hide .gitbook-table-of-contents { 87 | zoom: 1; 88 | filter: alpha(opacity=0); 89 | -webkit-opacity: 0; 90 | -moz-opacity: 0; 91 | opacity: 0; 92 | } 93 | .gitbook-table-of-contents h2 { 94 | color: #e73828; 95 | font-size: 20px; 96 | margin: 10px 0; 97 | } 98 | .gitbook-table-of-contents ul { 99 | list-style: none; 100 | margin: 0; 101 | padding: 0; 102 | } 103 | .gitbook-table-of-contents .levelNum { 104 | font-style: normal; 105 | } 106 | .gitbook-table-of-contents .gtoc-level { 107 | display: block; 108 | } 109 | .gitbook-table-of-contents .gtoc-level:hover { 110 | overflow: visible; 111 | } 112 | .gitbook-table-of-contents .gtoc-level.state-current { 113 | background-color: #f0f0f0; 114 | } 115 | .gitbook-table-of-contents .gtoc-level-h2 { 116 | padding-left: 15px; 117 | font-size: 16px; 118 | margin-top: 15px; 119 | } 120 | .gitbook-table-of-contents .gtoc-level-h2, 121 | .gitbook-table-of-contents .gtoc-level-h2:active { 122 | color: #ea5414; 123 | } 124 | .gitbook-table-of-contents .gtoc-level-h3 { 125 | padding-left: 39px; 126 | font-size: 15px; 127 | margin-top: 5px; 128 | } 129 | .gitbook-table-of-contents .gtoc-level-h3, 130 | .gitbook-table-of-contents .gtoc-level-h3:active { 131 | color: #2DA7E0; 132 | } 133 | .gitbook-table-of-contents .icon-shrink { 134 | position: absolute; 135 | cursor: pointer; 136 | right: 10px; 137 | top: 15px; 138 | } 139 | .gitbook-table-of-contents .icon-shrink:hover { 140 | right: 8px; 141 | } 142 | .gtoc-menu { 143 | position: relative; 144 | } 145 | .gtoc-menu-min { 146 | margin-bottom: -40px; 147 | right: 270px; 148 | zoom: 1; 149 | filter: alpha(opacity=100); 150 | -webkit-opacity: 1; 151 | -moz-opacity: 1; 152 | opacity: 1; 153 | position: fixed; 154 | top: 50%; 155 | -webkit-transform: translate3d(0, -50%, 0); 156 | -moz-transform: translate3d(0, -50%, 0); 157 | -ms-transform: translate3d(0, -50%, 0); 158 | -o-transform: translate3d(0, -50%, 0); 159 | transform: translate3d(0, -50%, 0); 160 | -webkit-transition: 1s; 161 | -moz-transition: 1s; 162 | -o-transition: 1s; 163 | transition: 1s; 164 | } 165 | .state-min .gtoc-menu-min { 166 | -webkit-transform: translate3d(270px, -50%, 0); 167 | -moz-transform: translate3d(270px, -50%, 0); 168 | -ms-transform: translate3d(270px, -50%, 0); 169 | -o-transform: translate3d(270px, -50%, 0); 170 | transform: translate3d(270px, -50%, 0); 171 | } 172 | .state-hide .gtoc-menu-min { 173 | zoom: 1; 174 | filter: alpha(opacity=0); 175 | -webkit-opacity: 0; 176 | -moz-opacity: 0; 177 | opacity: 0; 178 | } 179 | .gtoc-menu-min a { 180 | display: block; 181 | text-align: center; 182 | width: 40px; 183 | height: 40px; 184 | line-height: 40px; 185 | border: 1px solid #c9caca; 186 | background-color: #ea5414; 187 | } 188 | .gtoc-menu-min a, 189 | .gtoc-menu-min a:hover { 190 | color: white; 191 | } 192 | .gtoc-menu-min a:hover { 193 | background-color: #bb4310; 194 | } 195 | .gtoc-menu-min .icon-top { 196 | background: #ea5414 url(https://lh3.googleusercontent.com/-o86W7i9pt84/VJK1tQLDoLI/AAAAAAAACM0/tC4qyX9d08Y/s800/icon-up_03.png) no-repeat center center; 197 | } 198 | .gtoc-menu-min .word { 199 | display: inline-block; 200 | float: left; 201 | width: 38px; 202 | height: 37px; 203 | } 204 | .gtoc-menu-min .word-hover { 205 | display: none; 206 | } 207 | .gtoc-menu-min .state-hover .word-normal { 208 | display: none; 209 | } 210 | .gtoc-menu-min .state-hover .word-hover { 211 | display: inline-block; 212 | line-height: 18px; 213 | } 214 | -------------------------------------------------------------------------------- /book/gtoc.js: -------------------------------------------------------------------------------- 1 | require.config({ 2 | "baseUrl":"../gitbook/plugins" 3 | }); 4 | 5 | require(["gitbook","gitbook-plugin-gtoc/mod/content", 6 | "gitbook-plugin-gtoc/mod/interaction", 7 | "gitbook-plugin-gtoc/mod/elevator" 8 | ], 9 | function(gitbook,content,action,elevator) { 10 | 11 | // 配置默认参数 12 | var defaultConfig = { 13 | "hide":true // 默认是隐藏模式 14 | ,"el":"h2,h3" // 待抽取元素名,默认是抽取h2,h3标题,标准的jQuery选择表达式 15 | ,"elevator":true // 默认有电梯效果 16 | 17 | }; 18 | 19 | var resetToc = function(config){ 20 | var $ibook = gitbook.state.$book; 21 | 22 | var _config = $.extend(defaultConfig,config); 23 | 24 | // 获取目录结构 25 | var $toc = content.init($ibook,_config); 26 | // 将TOC绑定到文章里面 27 | $ibook.find(".book-body").append($toc); 28 | 29 | // 是否默认隐藏 30 | if(_config.hide){ 31 | $toc.addClass("state-min"); 32 | }; 33 | 34 | // 交互初始化 35 | action.init($toc); 36 | 37 | // 默认开启“电梯”效果 38 | if(_config.elevator){ 39 | elevator.init($toc);// 初始化电梯 40 | } 41 | 42 | }; 43 | 44 | 45 | // 创建目录 46 | var init = function() { 47 | var config = {}; 48 | resetToc(config); 49 | }; 50 | 51 | // 当刷新页面的时候,重新创建目录 52 | gitbook.events.bind("page.change", function() { 53 | init(); 54 | }); 55 | }); -------------------------------------------------------------------------------- /book/gtoc.less: -------------------------------------------------------------------------------- 1 | @import "lesshat"; 2 | /* 文字不换行 */ 3 | .no-breakline{ 4 | white-space: nowrap; 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | &:hover{ 8 | overflow: visible; 9 | } 10 | } 11 | 12 | 13 | /* fixed垂直居中 */ 14 | .fixed-common{ 15 | .opacity(1); 16 | position: fixed; 17 | top: 50%; 18 | .translate3d(0,-50%,0); 19 | .transition(1s); 20 | 21 | 22 | // 动画状态 23 | .state-min &{ 24 | .translate3d((@width_toc+@pos_offset),-50%,0); 25 | } 26 | 27 | // 隐藏状态,只更改透明度 28 | .state-hide &{ 29 | .opacity(0); 30 | } 31 | } 32 | 33 | 34 | @c-red:#E73828; 35 | @c-orange-1:#EA5414; 36 | @c-gray:#C9CACA; 37 | 38 | @color-theme-1:#f3eacb; 39 | @color-theme-2:#111; 40 | 41 | @width_toc:250px; 42 | @pos_offset:20px; 43 | .gitbook-table-of-contents{ 44 | padding:0 15px 15px 15px; 45 | 46 | background-color:rgba(255,255,255,1); 47 | .color-theme-1 &{ 48 | background-color: lighten(@color-theme-1, 4%) 49 | } 50 | 51 | .color-theme-2 &{ 52 | background-color: lighten(@color-theme-2, 10%) 53 | } 54 | 55 | right: @pos_offset; 56 | border: 1px solid @c-gray; 57 | border-top:5px solid @c-orange-1; 58 | width:@width_toc; 59 | z-index:99; 60 | 61 | 62 | // 超过窗口就显示滚动条 63 | max-height: 100%; 64 | 65 | // 当高度超过时,显示滚动条 66 | .state-scroll &{ 67 | overflow-y: scroll; 68 | } 69 | 70 | 71 | .fixed-common; 72 | 73 | 74 | h2{ 75 | color:@c-red; 76 | font-size:20px; 77 | margin:10px 0; 78 | } 79 | 80 | ul{ 81 | list-style: none; 82 | margin: 0; 83 | padding: 0; 84 | } 85 | 86 | .levelNum{ 87 | font-style: normal; 88 | } 89 | 90 | @pd-step:15px; 91 | .gtoc-level{ 92 | display: block; 93 | 94 | &:extend(.no-breakline);// 文字不换行 95 | 96 | // hover上去显示完整的文字 97 | &:hover{ 98 | overflow: visible; 99 | } 100 | 101 | // 背景 102 | &.state-current{ 103 | background-color: lighten(@c-gray, 15%) 104 | } 105 | 106 | } 107 | .gtoc-level-h2{ 108 | padding-left: @pd-step; 109 | 110 | font-size: 16px; 111 | margin-top:15px; 112 | &,&:active{ 113 | color:@c-orange-1; 114 | } 115 | } 116 | .gtoc-level-h3{ 117 | padding-left: @pd-step*2 + 9; 118 | font-size:15px; 119 | margin-top:5px; 120 | &,&:active{ 121 | color:#2DA7E0; 122 | } 123 | } 124 | 125 | 126 | // arrow img 127 | .icon-shrink{ 128 | position: absolute; 129 | cursor: pointer; 130 | right: 10px; 131 | top: 15px; 132 | 133 | &:hover{ 134 | right:8px; 135 | } 136 | } 137 | } 138 | 139 | .gtoc-menu{ 140 | position: relative; 141 | } 142 | 143 | // 小导航栏 144 | .gtoc-menu-min{ 145 | 146 | @size:40px; 147 | margin-bottom: -40px; 148 | right: @size + @width_toc - @pos_offset; 149 | 150 | .fixed-common; 151 | 152 | 153 | a{ 154 | display: block; 155 | text-align: center; 156 | width:@size; 157 | height:@size; 158 | line-height: @size; 159 | border:1px solid @c-gray; 160 | background-color:@c-orange-1; 161 | &,&:hover{ 162 | color:white; 163 | } 164 | 165 | &:hover{ 166 | background-color:darken(@c-orange-1, 10%); 167 | } 168 | } 169 | 170 | .icon-top{ 171 | background:@c-orange-1 url(https://lh3.googleusercontent.com/-o86W7i9pt84/VJK1tQLDoLI/AAAAAAAACM0/tC4qyX9d08Y/s800/icon-up_03.png) no-repeat center center; 172 | } 173 | 174 | 175 | // hover 文字 176 | .word{ 177 | display: inline-block; 178 | float:left; 179 | width:@size - 2; 180 | height:@size - 3; 181 | } 182 | 183 | .word-hover{ 184 | display: none; 185 | } 186 | 187 | .state-hover{ 188 | .word-normal{ 189 | display: none; 190 | } 191 | .word-hover{ 192 | display: inline-block; 193 | line-height: 18px; 194 | } 195 | } 196 | 197 | } 198 | -------------------------------------------------------------------------------- /book/lesshat.less: -------------------------------------------------------------------------------- 1 | // * =========================================================== * 2 | // < LESSHat > 3 | // * =========================================================== * 4 | // 5 | // Made with Energy drinks in Prague, Czech Republic. 6 | // Handcrafted by Petr Brzek, lesshat.com 7 | // Works great with CSS Hat csshat.com 8 | 9 | // version: v3.0.2 (2014-06-26) 10 | 11 | // TABLE OF MIXINS: 12 | // align-content 13 | // align-items 14 | // align-self 15 | // animation 16 | // animation-delay 17 | // animation-direction 18 | // animation-duration 19 | // animation-fill-mode 20 | // animation-iteration-count 21 | // animation-name 22 | // animation-play-state 23 | // animation-timing-function 24 | // appearance 25 | // backface-visibility 26 | // background-clip 27 | // background-image 28 | // background-origin 29 | // background-size 30 | // blur 31 | // border-bottom-left-radius 32 | // border-bottom-right-radius 33 | // border-image 34 | // border-radius 35 | // border-top-left-radius 36 | // border-top-right-radius 37 | // box-shadow 38 | // box-sizing 39 | // brightness 40 | // calc 41 | // column-count 42 | // column-gap 43 | // column-rule 44 | // column-width 45 | // columns 46 | // contrast 47 | // display 48 | // drop-shadow 49 | // filter 50 | // flex 51 | // flex-basis 52 | // flex-direction 53 | // flex-grow 54 | // flex-shrink 55 | // flex-wrap 56 | // font-face 57 | // grayscale 58 | // hue-rotate 59 | // hyphens 60 | // invert 61 | // justify-content 62 | // keyframes 63 | // opacity 64 | // order 65 | // perspective 66 | // perspective-origin 67 | // placeholder 68 | // rotate 69 | // rotate3d 70 | // rotateX 71 | // rotateY 72 | // rotateZ 73 | // saturate 74 | // scale 75 | // scale3d 76 | // scaleX 77 | // scaleY 78 | // scaleZ 79 | // selection 80 | // sepia 81 | // size 82 | // skew 83 | // skewX 84 | // skewY 85 | // transform 86 | // transform-origin 87 | // transform-style 88 | // transition 89 | // transition-delay 90 | // transition-duration 91 | // transition-property 92 | // transition-timing-function 93 | // translate 94 | // translate3d 95 | // translateX 96 | // translateY 97 | // translateZ 98 | // user-select 99 | 100 | .align-content(...) { 101 | @process: ~`(function(r){return r=r||"stretch"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 102 | @process_ms: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t?t="end":"space-between"==t?t="justify":"space-around"==t&&(t="distribute"),t})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 103 | -webkit-align-content: @process; 104 | -ms-flex-line-pack: @process_ms; 105 | align-content: @process; 106 | } 107 | 108 | .align-items(...) { 109 | @process_olderwebkit: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 110 | @process_moz: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 111 | @process: ~`(function(t){return t=t||"stretch"})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 112 | @process_ms: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 113 | -webkit-box-align: @process_olderwebkit; 114 | -moz-box-align: @process_moz; 115 | -webkit-align-items: @process; 116 | -ms-flex-align: @process_ms; 117 | align-items: @process; 118 | } 119 | 120 | .align-self(...) { 121 | @process: ~`(function(t){return t=t||"auto"})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 122 | @process_ms: ~`(function(t){return t=t||"auto","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 123 | -webkit-align-self: @process; 124 | -ms-flex-item-align: @process_ms; 125 | align-self: @process; 126 | } 127 | 128 | .animation(...) { 129 | @process: ~`(function(t){return t=t||"none",/^[^, ]*,/.test(t)&&(t=t.replace(/(?:,)(?![^(]*\))/g,"")),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 130 | -webkit-animation: @process; 131 | -moz-animation: @process; 132 | -o-animation: @process; 133 | animation: @process; 134 | } 135 | 136 | .animation-delay(...) { 137 | @process: ~`(function(t){t=t||"0";var r=/(?:\d)(?:ms|s)/gi,e=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(t)||"0"===t||(t=t.replace(e,function(t){return t+=parseFloat(t,10)>10?"ms":"s"})),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 138 | -webkit-animation-delay: @process; 139 | -moz-animation-delay: @process; 140 | -o-animation-delay: @process; 141 | animation-delay: @process; 142 | } 143 | 144 | .animation-direction(...) { 145 | @process: ~`(function(r){return r||"normal"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 146 | -webkit-animation-direction: @process; 147 | -moz-animation-direction: @process; 148 | -o-animation-direction: @process; 149 | animation-direction: @process; 150 | } 151 | 152 | .animation-duration(...) { 153 | @process: ~`(function(r){r=r||"0";var t=/ms|s/gi,e=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(r)||"0"===r||(r=r.replace(e,function(r){return r+=parseFloat(r,10)>10?"ms":"s"})),r})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 154 | -webkit-animation-duration: @process; 155 | -moz-animation-duration: @process; 156 | -o-animation-duration: @process; 157 | animation-duration: @process; 158 | } 159 | 160 | .animation-fill-mode(...) { 161 | @process: ~`(function(r){return r||"none"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 162 | -webkit-animation-fill-mode: @process; 163 | -moz-animation-fill-mode: @process; 164 | -o-animation-fill-mode: @process; 165 | animation-fill-mode: @process; 166 | } 167 | 168 | .animation-iteration-count(...) { 169 | @process: ~`(function(r){return r||"0"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 170 | -webkit-animation-iteration-count: @process; 171 | -moz-animation-iteration-count: @process; 172 | -o-animation-iteration-count: @process; 173 | animation-iteration-count: @process; 174 | } 175 | 176 | .animation-name(...) { 177 | @process: ~`(function(r){return r||"none"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 178 | -webkit-animation-name: @process; 179 | -moz-animation-name: @process; 180 | -o-animation-name: @process; 181 | animation-name: @process; 182 | } 183 | 184 | .animation-play-state(...) { 185 | @process: ~`(function(r){return r||"running"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 186 | -webkit-animation-play-state: @process; 187 | -moz-animation-play-state: @process; 188 | -o-animation-play-state: @process; 189 | animation-play-state: @process; 190 | } 191 | 192 | .animation-timing-function(...) { 193 | @process: ~`(function(r){return r||"ease"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 194 | -webkit-animation-timing-function: @process; 195 | -moz-animation-timing-function: @process; 196 | -o-animation-timing-function: @process; 197 | animation-timing-function: @process; 198 | } 199 | 200 | .appearance(...) { 201 | @process: ~`(function(r){return r||"none"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 202 | -webkit-appearance: @process; 203 | -moz-appearance: @process; 204 | appearance: @process; 205 | } 206 | 207 | .backface-visibility(...) { 208 | @process: ~`(function(r){return r||"visible"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 209 | -webkit-backface-visibility: @process; 210 | -moz-backface-visibility: @process; 211 | -ms-backface-visibility: @process; 212 | -o-backface-visibility: @process; 213 | backface-visibility: @process; 214 | } 215 | 216 | .background-clip(...) { 217 | @process: ~`(function(r){return r||"border-box"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 218 | -webkit-background-clip: @process; 219 | -moz-background-clip: @process; 220 | background-clip: @process; 221 | } 222 | 223 | .background-image(...) { 224 | @process_ms: ~`(function(t){function e(t){var e,r,n,a,s,i,u,o,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,f="",d=[];if(!t)return t;do e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),o=e<<16|r<<8|n,a=63&o>>18,s=63&o>>12,i=63&o>>6,u=63&o,d[l++]=g.charAt(a)+g.charAt(s)+g.charAt(i)+g.charAt(u);while(c',svg_start:'',linear_gradient_start:'",radial_gradient_end:"",rect_linear:'',rect_radial:'',svg_end:""};if(r.length){r.forEach(function(t){var e={};if(Object.keys(a).some(function(r){return t.indexOf(r)>=0?(e.svg_direction=a[r],!0):(e.svg_direction=!1,void 0)}),/linear/.test(t))e.svg_type="linear";else if(/radial/.test(t))e.svg_type="radial";else if(!/linear/.test(t)&&!/radial/.test(t))return e.url=t.trim(),e.svg_type="url",e.svg_direction=!0,n.push(e),!1;var r=t.match(/rgb|#[a-zA-Z0-9]|hsl/g).length;e.svg_stops=[],t=t.replace(/transparent/g,"rgba(0,0,0,0)"),t.match(/#[a-zA-Z0-9]/g)&&t.match(/(#[a-zA-Z0-9]+)\s*(\d+%)?/g).forEach(function(t){t=t.split(" "),e.svg_stops.push('')}),t.match(/rgba?\(\d+,\s*\d+,\s*\d+(?:,\s*(0|1|\.\d+|0\.\d+))?\)/g)&&t.replace(/rgba?\((\d+,\s*\d+,\s*\d+)(?:,\s*(0|1|\.\d+|0\.\d+))?\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('')}),t.match(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)/g)&&t.replace(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('')});var s=Math.floor(100/(r-1));e.svg_stops.forEach(function(t,r){/offset="false"/.test(t)&&(e.svg_stops[r]=t.replace(/offset="false"/,'offset="'+s*r+'%"'))}),e.svg_stops.sort(function(t,e){return t=t.match(/offset="(\d+)%"/),e=e.match(/offset="(\d+)%"/),2==t.length&&2==e.length?t[1]-e[1]:void 0}),n.push(e)});var i=[],u=n.every(function(t){for(var e in t)if(0==t[e]||0==t[e].length)return!1;return!0});if(!u)return 8121991;n.forEach(function(t,e){("linear"==t.svg_type||"radial"==t.svg_type)&&(i[e]=s.xml+s.svg_start),"linear"==t.svg_type?(i[e]+=s.linear_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.linear_gradient_end,i[e]+=s.rect_linear,i[e]+=s.svg_end):"radial"==t.svg_type?(i[e]+=s.radial_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.radial_gradient_end,i[e]+=s.rect_radial,i[e]+=s.svg_end):"url"==t.svg_type&&(i[e]=t.url)}),i.forEach(function(t,r){/<\?xml version="1.0" \?>/g.test(t)&&(i[r]=s.uri_data+e(t)+")")}),t=i.join(",")}return t})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 225 | @process_webkit: ~`(function(t){if(t=t||8121991,8121991==t)return t;var e={"to bottom":"top","to left":"right","to top":"bottom","to right":"left","ellipse at center":"center, ellipse cover","circle closest-side":"center center, circle contain","circle farthest-corner":"center center, circle cover","circle farthest-side":"center center, circle cover","ellipse closest-side":"center center, ellipse contain","ellipse farthest-corner":"center center, ellipse cover","ellipse farthest-side":"center center, ellipse cover"},r=/(radial-gradient\()([a-z- ]+)at\s+(\w+%?)\s*(\w*%?)/g,n=Object.keys(e);return n.some(function(n){return t.indexOf(n)>=0?(t=t.replace(new RegExp(n+"(?![ a-z0-9])","g"),e[n]),!0):(r.test(t)&&(t=t.replace(r,function(t,e,r,n,a){return e.trim()+n.trim()+" "+a.trim()+","+r.replace(/closest-side/g,"contain").replace(/farthest-corner/g,"cover").trim()})),void 0)}),t=t.replace(/(\d+)\s*deg/g,function(t,e){return 90-e+"deg"}).replace(/(linear|radial)-gradient/g,"-webkit-$1-gradient")})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 226 | @process_moz: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t={"to bottom":"top","to left":"right","to top":"bottom","to right":"left","ellipse at center":"center, ellipse cover","circle closest-side":"center center, circle contain","circle farthest-corner":"center center, circle cover","circle farthest-side":"center center, circle cover","ellipse closest-side":"center center, ellipse contain","ellipse farthest-corner":"center center, ellipse cover","ellipse farthest-side":"center center, ellipse cover"},r=/(radial-gradient\()([a-z- ]+)at\s+(\w+%?)\s*(\w*%?)/g,n=Object.keys(t);return n.some(function(n){return e.indexOf(n)>=0?(e=e.replace(new RegExp(n+"(?![ a-z0-9])","g"),t[n]),!0):(r.test(e)&&(e=e.replace(r,function(e,t,r,n,a){return t.trim()+n.trim()+" "+a.trim()+","+r.replace(/closest-side/g,"contain").replace(/farthest-corner/g,"cover").trim()})),void 0)}),e=e.replace(/(\d+)\s*deg/g,function(e,t){return 90-t+"deg"}).replace(/(linear|radial)-gradient/g,"-moz-$1-gradient")})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 227 | @process_opera: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t={"to bottom":"top","to left":"right","to top":"bottom","to right":"left","ellipse at center":"center, ellipse cover","circle closest-side":"center center, circle contain","circle farthest-corner":"center center, circle cover","circle farthest-side":"center center, circle cover","ellipse closest-side":"center center, ellipse contain","ellipse farthest-corner":"center center, ellipse cover","ellipse farthest-side":"center center, ellipse cover"},r=/(radial-gradient\()([a-z- ]+)at\s+(\w+%?)\s*(\w*%?)/g,n=Object.keys(t);return n.some(function(n){return e.indexOf(n)>=0?(e=e.replace(new RegExp(n+"(?![ a-z0-9])","g"),t[n]),!0):(r.test(e)&&(e=e.replace(r,function(e,t,r,n,a){return t.trim()+n.trim()+" "+a.trim()+","+r.replace(/closest-side/g,"contain").replace(/farthest-corner/g,"cover").trim()})),void 0)}),e=e.replace(/(\d+)\s*deg/g,function(e,t){return 90-t+"deg"}).replace(/(linear|radial)-gradient/g,"-o-$1-gradient")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 228 | @process: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t={top:"to bottom",right:"to left",bottom:"to top",left:"to right"},r=Object.keys(t);return r.some(function(r){return e.indexOf(r)>=0&&!new RegExp("to\\s+"+r+"|at\\s+"+r,"g").test(e)?(e=e.replace(new RegExp(r),t[r]),!0):void 0}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 229 | background-image: @process_ms; 230 | background-image: @process_webkit; 231 | background-image: @process_moz; 232 | background-image: @process_opera; 233 | background-image: @process; 234 | } 235 | 236 | .background-origin(...) { 237 | @process: ~`(function(e){return e||"padding-box"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 238 | -webkit-background-origin: @process; 239 | -moz-background-origin: @process; 240 | background-origin: @process; 241 | } 242 | 243 | .background-size(...) { 244 | @process: ~`(function(e){e=e||"auto auto";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 245 | -webkit-background-size: @process; 246 | -moz-background-size: @process; 247 | background-size: @process; 248 | } 249 | 250 | .blur(...) { 251 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 252 | -webkit-filter: blur(@process); 253 | -moz-filter: blur(@process); 254 | -ms-filter: blur(@process); 255 | filter: blur(@process); 256 | } 257 | 258 | .border-bottom-left-radius(...) { 259 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 260 | -webkit-border-bottom-left-radius: @process; -webkit-background-clip: padding-box; 261 | -moz-border-radius-bottomleft: @process; -moz-background-clip: padding; 262 | border-bottom-left-radius: @process; background-clip: padding-box; 263 | } 264 | 265 | .border-bottom-right-radius(...) { 266 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 267 | -webkit-border-bottom-right-radius: @process; -webkit-background-clip: padding-box; 268 | -moz-border-radius-bottomright: @process; -moz-background-clip: padding; 269 | border-bottom-right-radius: @process; background-clip: padding-box; 270 | } 271 | 272 | .border-image(...) { 273 | @process: ~`(function(e){return e=e||8121991,/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 274 | -webkit-border-image: @process; 275 | -moz-border-image: @process; 276 | -o-border-image: @process; 277 | border-image: @process; 278 | } 279 | 280 | .border-radius(...) { 281 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 282 | -webkit-border-radius: @process; -webkit-background-clip: padding-box; 283 | -moz-border-radius: @process; -moz-background-clip: padding; 284 | border-radius: @process; background-clip: padding-box; 285 | } 286 | 287 | .border-top-left-radius(...) { 288 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 289 | -webkit-border-top-left-radius: @process; -webkit-background-clip: padding-box; 290 | -moz-border-radius-topleft: @process; -moz-background-clip: padding; 291 | border-top-left-radius: @process; background-clip: padding-box; 292 | } 293 | 294 | .border-top-right-radius(...) { 295 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 296 | -webkit-border-top-right-radius: @process; -webkit-background-clip: padding-box; 297 | -moz-border-radius-topright: @process; -moz-background-clip: padding; 298 | border-top-right-radius: @process; background-clip: padding-box; 299 | } 300 | 301 | .box-shadow(...) { 302 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 303 | -webkit-box-shadow: @process; 304 | -moz-box-shadow: @process; 305 | box-shadow: @process; 306 | } 307 | 308 | .box-sizing(...) { 309 | @process: ~`(function(e){return e=e||"content-box"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 310 | -webkit-box-sizing: @process; 311 | -moz-box-sizing: @process; 312 | box-sizing: @process; 313 | } 314 | 315 | .brightness(...) { 316 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 317 | -webkit-filter: brightness(@process); 318 | -moz-filter: brightness(@process); 319 | -ms-filter: brightness(@process); 320 | filter: brightness(@process); 321 | } 322 | 323 | .calc(...) { 324 | @process: ~`(function(e){function t(t,r){var a=");\n",c=n.split(","),i=c[0]+":"+t+"("+(c[1].trim()||0)+a;"start"==r?e="0;\n"+i:e+=i}e=e||8121991;var r="@{state}",n=e;if(8121991==e)return e;switch(r){case"1":t("-webkit-calc","start"),t("-moz-calc"),t("calc");break;case"2":t("-webkit-calc","start"),t("-moz-calc");break;case"3":t("-webkit-calc","start"),t("calc");break;case"4":t("-webkit-calc","start");break;case"5":t("-moz-calc","start"),t("calc");break;case"6":t("-moz-calc","start");break;case"7":t("calc","start")}return e=e.replace(/;$/g,"")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 325 | @state: 1; -lh-property: @process; 326 | 327 | } 328 | 329 | .column-count(...) { 330 | @process: ~`(function(e){return e=e||"auto"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 331 | -webkit-column-count: @process; 332 | -moz-column-count: @process; 333 | column-count: @process; 334 | } 335 | 336 | .column-gap(...) { 337 | @process: ~`(function(e){e=e||"normal";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 338 | -webkit-column-gap: @process; 339 | -moz-column-gap: @process; 340 | column-gap: @process; 341 | } 342 | 343 | .column-rule(...) { 344 | @process: ~`(function(e){e=e||"medium none black";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 345 | -webkit-column-rule: @process; 346 | -moz-column-rule: @process; 347 | column-rule: @process; 348 | } 349 | 350 | .column-width(...) { 351 | @process: ~`(function(e){e=e||"auto";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 352 | -webkit-column-width: @process; 353 | -moz-column-width: @process; 354 | column-width: @process; 355 | } 356 | 357 | .columns(...) { 358 | @process: ~`(function(e){e=e||"auto auto";var t=/^\d+$/;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,""),e=e.split(" ")),t.test(e[0])&&(e[0]=e[0]+"px"),e.join(" ")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 359 | -webkit-columns: @process; 360 | -moz-columns: @process; 361 | columns: @process; 362 | } 363 | 364 | .contrast(...) { 365 | @process: ~`(function(e){e=e||"100%";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 366 | -webkit-filter: ~"contrast(@{process})"; 367 | -moz-filter: ~"contrast(@{process})"; 368 | -ms-filter: ~"contrast(@{process})"; 369 | filter: ~"contrast(@{process})"; 370 | } 371 | 372 | .display(...) { 373 | @process_oldwebkit: ~`(function(e){return e="flex"==e||"inline-flex"==e?"-webkit-box":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 374 | @process_moz: ~`(function(e){return e="flex"==e||"inline-flex"==e?"-moz-box":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 375 | @process_webkit: ~`(function(e){return e="flex"==e||"inline-flex"==e?"-webkit-"+e:8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 376 | @process_ms: ~`(function(e){return e="flex"==e?"-ms-flexbox":"inline-flex"==e?"-ms-inline-flexbox":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 377 | @process: ~`(function(e){return"flex"!=e&&"inline-flex"!=e&&(e=8121991),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 378 | display: @process_oldwebkit; 379 | display: @process_moz; 380 | display: @process_webkit; 381 | display: @process_ms; 382 | display: @process; 383 | } 384 | 385 | .drop-shadow(...) { 386 | @process: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 387 | -webkit-filter: drop-shadow(@process); 388 | -moz-filter: drop-shadow(@process); 389 | -ms-filter: drop-shadow(@process); 390 | filter: drop-shadow(@process); 391 | } 392 | 393 | .filter(...) { 394 | @process: ~`(function(e){return e=e||"none",/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 395 | -webkit-filter: @process; 396 | -moz-filter: @process; 397 | -ms-filter: @process; 398 | filter: @process; 399 | } 400 | 401 | .flex(...) { 402 | @process_olderwebkit: ~`(function(e){return/^\d+/.test(e)?e=e.match(/^\d+/)[0]:""==e&&(e="0"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 403 | @process_moz: ~`(function(e){return/^\d+/.test(e)?e=e.match(/^\d+/)[0]:""==e&&(e="0"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 404 | @process: ~`(function(e){return e=e||"0 1 auto",/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 405 | -webkit-box-flex: @process_olderwebkit; 406 | -moz-box-flex: @process_moz; 407 | -webkit-flex: @process; 408 | -ms-flex: @process; 409 | flex: @process; 410 | } 411 | 412 | .flex-basis(...) { 413 | @process: ~`(function(e){e=e||"auto";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 414 | -webkit-flex-basis: @process; 415 | flex-basis: @process; 416 | } 417 | 418 | .flex-direction(...) { 419 | @process_oldestwebkit: ~`(function(e){return e="row"==e||"column"==e?"normal":"row-reverse"==e||"column-reverse"==e?"reverse":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 420 | @process_oldermoz: ~`(function(e){return e="row"==e||"column"==e?"normal":"row-reverse"==e||"column-reverse"==e?"reverse":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 421 | @process_olderwebkit: ~`(function(e){return e="row"==e||"row-reverse"==e?"horizontal":"column"==e||"column-reverse"==e?"vertical":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 422 | @process_moz: ~`(function(e){return e="row"==e||"row-reverse"==e?"horizontal":"column"==e||"column-reverse"==e?"vertical":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 423 | @process: ~`(function(e){return e=e||"row"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 424 | -webkit-box-direction: @process_oldestwebkit; 425 | -moz-box-direction: @process_oldermoz; 426 | -webkit-box-orient: @process_olderwebkit; 427 | -moz-box-orient: @process_moz; 428 | -webkit-flex-direction: @process; 429 | -ms-flex-direction: @process; 430 | flex-direction: @process; 431 | } 432 | 433 | .flex-grow(...) { 434 | @process: ~`(function(e){return e=e||"0"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 435 | -webkit-flex-grow: @process; 436 | flex-grow: @process; 437 | } 438 | 439 | .flex-shrink(...) { 440 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 441 | -webkit-flex-shrink: @process; 442 | flex-shrink: @process; 443 | } 444 | 445 | .flex-wrap(...) { 446 | @process: ~`(function(e){return e=e||"nowrap"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 447 | -webkit-flex-wrap: @process; 448 | -ms-flex-wrap: @process; 449 | flex-wrap: @process; 450 | } 451 | 452 | .font-face(@fontname, @fontfile, @fontweight:normal, @fontstyle:normal) { 453 | font-family: "@{fontname}"; 454 | src: url("@{fontfile}.eot"); 455 | src: url("@{fontfile}.eot?#iefix") format("embedded-opentype"), 456 | url("@{fontfile}.woff") format("woff"), 457 | url("@{fontfile}.ttf") format("truetype"), 458 | url("@{fontfile}.svg#@{fontname}") format("svg"); 459 | font-weight: @fontweight; 460 | font-style: @fontstyle; 461 | } 462 | 463 | .grayscale(...) { 464 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 465 | -webkit-filter: grayscale(@process); 466 | -moz-filter: grayscale(@process); 467 | -ms-filter: grayscale(@process); 468 | filter: grayscale(@process); 469 | } 470 | 471 | .hue-rotate(...) { 472 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 473 | -webkit-filter: hue-rotate(@process); 474 | -moz-filter: hue-rotate(@process); 475 | -ms-filter: hue-rotate(@process); 476 | filter: hue-rotate(@process); 477 | } 478 | 479 | .hyphens(...) { 480 | @process: ~`(function(e){return e=e||"manual"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 481 | -webkit-hyphens: @process; 482 | -moz-hyphens: @process; 483 | -ms-hyphens: @process; 484 | hyphens: @process; 485 | } 486 | 487 | .invert(...) { 488 | @process: ~`(function(e){e=e||"100%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 489 | -webkit-filter: invert(@process); 490 | -moz-filter: invert(@process); 491 | -ms-filter: invert(@process); 492 | filter: invert(@process); 493 | } 494 | 495 | .justify-content(...) { 496 | @process_oldestWebkit: ~`(function(e){return e=e||"start","flex-start"==e?e="start":"flex-end"==e?e="end":("space-between"==e||"space-around"==e)&&(e="justify"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 497 | @process_moz: ~`(function(e){return e=e||"start","flex-start"==e?e="start":"flex-end"==e?e="end":("space-between"==e||"space-around"==e)&&(e="justify"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 498 | @process_ms: ~`(function(e){return e=e||"start","flex-start"==e?e="start":"flex-end"==e?e="end":"space-between"==e?e="justify":"space-around"==e&&(e="distribute"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 499 | @process: ~`(function(e){return e=e||"flex-start"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 500 | -webkit-box-pack: @process_oldestWebkit; 501 | -moz-box-pack: @process_moz; 502 | -ms-flex-pack: @process_ms; 503 | -webkit-justify-content: @process; 504 | justify-content: @process; 505 | } 506 | 507 | .keyframes(...) { 508 | @process: ~`(function(e){function r(r,t,c){var i="}\n",u=n.split(/(^[a-zA-Z0-9-]+),/g),s=t+" "+u[1]+"{",o=["-webkit-","-moz-","-ms-",""];c?a.forEach(function(r){-1!==e.indexOf(r)&&(u[2]=u[2].replace(new RegExp(r,"g"),function(e){return c+e}))}):u[2]=u[2].replace(/{([^}]+)}/g,function(e,r){var t=r.split(";");t.forEach(function(e,r){a.forEach(function(n){-1!==e.indexOf(n)&&(t[r]="",o.forEach(function(a){t[r]+=e.trim().replace(new RegExp(n,"g"),function(e){return a+e})+";"}))})});var n=t.join(";").replace(/;;/g,";");return e.replace(r,n)}),s+=u[2]+i,"start"==r?e="0; } \n"+s:"startend"==r?e="0; } \n"+s.replace(i,""):e+="end"==r?s.replace(i,""):s}e=e||8121991;var t="@{state}",n=e;if(8121991==e)return e;var a=["animation","transform","filter"];switch(t){case"1":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-moz-keyframes","-moz-"),r(null,"@-o-keyframes","-o-"),r("end","@keyframes");break;case"2":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-moz-keyframes","-moz-"),r("end","@keyframes");break;case"3":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-moz-keyframes","-moz-"),r("end","@-o-keyframes","-o-");break;case"4":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-o-keyframes","-o-"),r("end","@keyframes");break;case"5":r("start","@-webkit-keyframes","-webkit-"),r("end","@-moz-keyframes","-moz-");break;case"6":r("start","@-webkit-keyframes","-webkit-"),r("end","@-o-keyframes","-o-");break;case"7":r("start","@-webkit-keyframes","-webkit-"),r("end","@keyframes");break;case"8":r("startend","@-webkit-keyframes","-webkit-");break;case"9":r("start","@-moz-keyframes","-moz-"),r(null,"@-o-keyframes","-o-"),r("end","@keyframes");break;case"10":r("start","@-moz-keyframes","-moz-"),r("end","@-o-keyframes","-o-");break;case"11":r("start","@-moz-keyframes","-moz-"),r("end","@keyframes");break;case"12":r("startend","@-moz-keyframes","-moz-");break;case"13":r("start","@-o-keyframes","-o-"),r("end","@keyframes");break;case"14":r("startend","@-o-keyframes","-o-");break;case"15":r("startend","@keyframes")}return e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 509 | @state: 1; lesshat-selector { -lh-property: @process; } 510 | 511 | 512 | 513 | } 514 | 515 | .opacity(...) { 516 | @process_ms: ~`(function(e){return e=e||"filter: alpha(opacity=100)","alpha(opacity="+Math.floor(100*e)+")"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 517 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 518 | zoom: 1; filter: @process_ms; 519 | -webkit-opacity: @process; 520 | -moz-opacity: @process; 521 | opacity: @process; 522 | } 523 | 524 | .order(...) { 525 | @process: ~`(function(e){return e=e||"0"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 526 | -webkit-box-ordinal-group: @process; 527 | -moz-box-ordinal-group: @process; 528 | -ms-flex-order: @process; 529 | -webkit-order: @process; 530 | order: @process; 531 | } 532 | 533 | .perspective(...) { 534 | @process: ~`(function(e){e=e||"none";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 535 | -webkit-perspective: @process; 536 | -moz-perspective: @process; 537 | perspective: @process; 538 | } 539 | 540 | .perspective-origin(...) { 541 | @process: ~`(function(e){e=e||"50% 50%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 542 | -webkit-perspective-origin: @process; 543 | -moz-perspective-origin: @process; 544 | perspective-origin: @process; 545 | } 546 | 547 | .placeholder(@color:#aaa, @element: 08121991) { 548 | .inception (@arguments) when not (@element = 08121991) { 549 | @{element}::-webkit-input-placeholder { 550 | color: @color; 551 | } 552 | @{element}:-moz-placeholder { 553 | color: @color; 554 | } 555 | @{element}::-moz-placeholder { 556 | color: @color; 557 | } 558 | @{element}:-ms-input-placeholder { 559 | color: @color; 560 | } 561 | } 562 | .inception (@arguments) when (@element = 08121991) { 563 | &::-webkit-input-placeholder { 564 | color: @color; 565 | } 566 | &:-moz-placeholder { 567 | color: @color; 568 | } 569 | &::-moz-placeholder { 570 | color: @color; 571 | } 572 | &:-ms-input-placeholder { 573 | color: @color; 574 | } 575 | } 576 | .inception(@arguments); 577 | } 578 | 579 | .rotate(...) { 580 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 581 | -webkit-transform: rotate(@process); 582 | -moz-transform: rotate(@process); 583 | -ms-transform: rotate(@process); 584 | -o-transform: rotate(@process); 585 | transform: rotate(@process); 586 | } 587 | 588 | .rotate3d(...) { 589 | @process: ~`(function(e){return e=e||"0, 0, 0, 0",e=e.replace(/,\s*\d+$/,function(e){return e+"deg"})})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 590 | -webkit-transform: rotate3d(@process); 591 | -moz-transform: rotate3d(@process); 592 | -ms-transform: rotate3d(@process); 593 | -o-transform: rotate3d(@process); 594 | transform: rotate3d(@process); 595 | } 596 | 597 | .rotateX(...) { 598 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 599 | -webkit-transform: rotateX(@process); 600 | -moz-transform: rotateX(@process); 601 | -ms-transform: rotateX(@process); 602 | -o-transform: rotateX(@process); 603 | transform: rotateX(@process); 604 | } 605 | 606 | .rotateY(...) { 607 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 608 | -webkit-transform: rotateY(@process); 609 | -moz-transform: rotateY(@process); 610 | -ms-transform: rotateY(@process); 611 | -o-transform: rotateY(@process); 612 | transform: rotateY(@process); 613 | } 614 | 615 | .rotateZ(...) { 616 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 617 | -webkit-transform: rotateZ(@process); 618 | -moz-transform: rotateZ(@process); 619 | -ms-transform: rotateZ(@process); 620 | -o-transform: rotateZ(@process); 621 | transform: rotateZ(@process); 622 | } 623 | 624 | .saturate(...) { 625 | @process: ~`(function(e){e=e||"100%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 626 | -webkit-filter: ~"saturate(@{process})"; 627 | -moz-filter: ~"saturate(@{process})"; 628 | -ms-filter: ~"saturate(@{process})"; 629 | filter: ~"saturate(@{process})"; 630 | } 631 | 632 | .scale(...) { 633 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 634 | -webkit-transform: scale(@process); 635 | -moz-transform: scale(@process); 636 | -ms-transform: scale(@process); 637 | -o-transform: scale(@process); 638 | transform: scale(@process); 639 | } 640 | 641 | .scale3d(...) { 642 | @process: ~`(function(e){return e=e||"1, 1, 1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 643 | -webkit-transform: scale3d(@process); 644 | -moz-transform: scale3d(@process); 645 | -ms-transform: scale3d(@process); 646 | -o-transform: scale3d(@process); 647 | transform: scale3d(@process); 648 | } 649 | 650 | .scaleX(...) { 651 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 652 | -webkit-transform: scaleX(@process); 653 | -moz-transform: scaleX(@process); 654 | -ms-transform: scaleX(@process); 655 | -o-transform: scaleX(@process); 656 | transform: scaleX(@process); 657 | } 658 | 659 | .scaleY(...) { 660 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 661 | -webkit-transform: scaleY(@process); 662 | -moz-transform: scaleY(@process); 663 | -ms-transform: scaleY(@process); 664 | -o-transform: scaleY(@process); 665 | transform: scaleY(@process); 666 | } 667 | 668 | .scaleZ(...) { 669 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 670 | -webkit-transform: scaleZ(@process); 671 | -moz-transform: scaleZ(@process); 672 | -ms-transform: scaleZ(@process); 673 | -o-transform: scaleZ(@process); 674 | transform: scaleZ(@process); 675 | } 676 | 677 | .selection(...) { 678 | @process: ~`(function(e){function r(r,t){var a="}\n",c=n.split(","),u=(c[1]||"")+t+"{"+c[0]+a;"start"==r?e="0; } \n"+u:"startend"==r?e="0; } \n"+u.replace(a,""):e+="end"==r?u.replace(a,""):u}e=e||8121991;var t="@{state}",n=e;if(8121991==e)return e;switch(t){case"1":r("start","::selection"),r("end","::-moz-selection");break;case"2":r("startend","::selection");break;case"3":r("startend","::-moz-selection")}return e=e.replace(/;$/g,"")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 679 | @state: 1; lesshat-selector { -lh-property: @process; } 680 | 681 | } 682 | 683 | .sepia(...) { 684 | @process: ~`(function(e){e=e||"100%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 685 | -webkit-filter: sepia(@process); 686 | -moz-filter: sepia(@process); 687 | -ms-filter: sepia(@process); 688 | filter: sepia(@process); 689 | } 690 | 691 | .size(@square) { 692 | @unit: 'px'; 693 | .process(@square) when (ispixel(@square)), (isem(@square)), (ispercentage(@square)), (iskeyword(@square)) { 694 | width: @square; 695 | height: @square; 696 | } 697 | 698 | .process(@square) when not (ispixel(@square)) and not (isem(@square)) and not (ispercentage(@square)) and not (isstring(@square)) and not (iskeyword(@square)) { 699 | width: ~`@{square} + @{unit}`; 700 | height: ~`@{square} + @{unit}`; 701 | } 702 | 703 | .process(@square); 704 | 705 | } 706 | 707 | .size(@width, @height) { 708 | @unit: 'px'; 709 | .process(@width, @height) when (ispixel(@width)), (isem(@width)), (ispercentage(@width)), (iskeyword(@width)) { 710 | .kittens(@height) when (ispixel(@height)), (isem(@height)), (ispercentage(@height)), (iskeyword(@height)) { 711 | width: @width; 712 | height: @height; 713 | } 714 | .kittens(@height) when not (ispixel(@height)) and not (isem(@height)) and not (ispercentage(@height)) and not (iskeyword(@height)) { 715 | width: @width; 716 | height: ~`@{height} + @{unit}`; 717 | } 718 | .kittens(@height); 719 | } 720 | 721 | .process(@width, @height) when (ispixel(@height)), (isem(@height)), (ispercentage(@height)), (iskeyword(@height)) { 722 | .kittens(@width) when (ispixel(@width)), (isem(@width)), (ispercentage(@width)), (iskeyword(@width)) {} 723 | .kittens(@width) when not (ispixel(@width)) and not (isem(@width)) and not (ispercentage(@width)) and not (iskeyword(@width)) { 724 | width: ~`@{width} + @{unit}`; 725 | height: @height; 726 | } 727 | .kittens(@width); 728 | } 729 | 730 | .process(@width, @height) when not (ispixel(@width)) and not (isem(@width)) and not (ispercentage(@width)) and not (iskeyword(@width)) and not (ispixel(@height)) and not (isem(@height)) and not (ispercentage(@height)) and not (iskeyword(@height)) { 731 | width: ~`@{width} + @{unit}`; 732 | height: ~`@{height} + @{unit}`; 733 | } 734 | 735 | .process(@width, @height); 736 | 737 | } 738 | 739 | .skew(...) { 740 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 741 | -webkit-transform: skew(@process); 742 | -moz-transform: skew(@process); 743 | -ms-transform: skew(@process); 744 | -o-transform: skew(@process); 745 | transform: skew(@process); 746 | } 747 | 748 | .skewX(...) { 749 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 750 | -webkit-transform: skewX(@process); 751 | -moz-transform: skewX(@process); 752 | -ms-transform: skewX(@process); 753 | -o-transform: skewX(@process); 754 | transform: skewX(@process); 755 | } 756 | 757 | .skewY(...) { 758 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 759 | -webkit-transform: skewY(@process); 760 | -moz-transform: skewY(@process); 761 | -ms-transform: skewY(@process); 762 | -o-transform: skewY(@process); 763 | transform: skewY(@process); 764 | } 765 | 766 | .transform(...) { 767 | @process: ~`(function(e){e=e||"none";var r={translate:"px",rotate:"deg",rotate3d:"deg",skew:"deg"};/^\w*\(?[a-z0-9.]*\)?/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,""));for(var t in r)e.indexOf(t)>=0&&(e=e.replace(new RegExp(t+"[\\w]?\\([a-z0-9, %]*\\)"),function(e){var n=/(\d+\.?\d*)(?!\w|%)/g;return"rotate3d"==t&&(n=/,\s*\d+$/),e.replace(n,function(e){return e+r[t]})}));return e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 768 | -webkit-transform: @process; 769 | -moz-transform: @process; 770 | -ms-transform: @process; 771 | -o-transform: @process; 772 | transform: @process; 773 | } 774 | 775 | .transform-origin(...) { 776 | @process: ~`(function(e){e=e||"50% 50% 0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 777 | -webkit-transform-origin: @process; 778 | -moz-transform-origin: @process; 779 | -ms-transform-origin: @process; 780 | -o-transform-origin: @process; 781 | transform-origin: @process; 782 | } 783 | 784 | .transform-style(...) { 785 | @process: ~`(function(e){return e=e||"flat"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 786 | -webkit-transform-style: @process; 787 | -moz-transform-style: @process; 788 | -ms-transform-style: @process; 789 | -o-transform-style: @process; 790 | transform-style: @process; 791 | } 792 | 793 | .transition(...) { 794 | @process_webkit: ~`(function(e){e=e||"all 0 ease 0";var r=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],t="-webkit-",n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),n.test(e)||"0"===e||(e=e.replace(a,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 795 | @process_moz: ~`(function(e){e=e||"all 0 ease 0";var r=["background-size","box-shadow","column","transform","filter"],t="-moz-",n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),n.test(e)||"0"===e||(e=e.replace(a,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 796 | @process_opera: ~`(function(e){e=e||"all 0 ease 0";var r=["transform"],t="-o-",n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),n.test(e)||"0"===e||(e=e.replace(a,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 797 | @process: ~`(function(e){e=e||"all 0 ease 0";var r=["-webkit-","-moz-","-o-",""],t=["column","transform","filter"],n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,""));var c=e.split(/(?:,)(?![^(]*\))/g);return c.forEach(function(e,n){t.forEach(function(t){-1!==e.indexOf(t)&&(c[n]="",r.forEach(function(a,u){c[n]+=e.trim().replace(new RegExp(t,"g"),function(e){return a+e}),u10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 798 | -webkit-transition: @process_webkit; 799 | -moz-transition: @process_moz; 800 | -o-transition: @process_opera; 801 | transition: @process; 802 | } 803 | 804 | .transition-delay(...) { 805 | @process: ~`(function(e){e=e||"0";var r=/(?:\d)(?:ms|s)/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)||"0"===e||(e=e.replace(t,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 806 | -webkit-transition-delay: @process; 807 | -moz-transition-delay: @process; 808 | -o-transition-delay: @process; 809 | transition-delay: @process; 810 | } 811 | 812 | .transition-duration(...) { 813 | @process: ~`(function(e){e=e||"0";var r=/ms|s/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)||"0"===e||(e=e.replace(t,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 814 | -webkit-transition-duration: @process; 815 | -moz-transition-duration: @process; 816 | -o-transition-duration: @process; 817 | transition-duration: @process; 818 | } 819 | 820 | .transition-property(...) { 821 | @process_webkit: ~`(function(e){e=e||"all";var r=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],t="-webkit-";return r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 822 | @process_moz: ~`(function(e){e=e||"all";var r=["background-size","box-shadow","column","transform","filter"],t="-moz-";return r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 823 | @process_opera: ~`(function(e){e=e||"all";var r=["transform"],t="-o-";return r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 824 | @process: ~`(function(e){e=e||"all";var r=["-webkit-","-moz-","-o-",""],t=["column","transform","filter"],n=e.split(/(?:,)(?![^(]*\))/g);return n.forEach(function(e,a){t.forEach(function(t){-1!==e.indexOf(t)&&(n[a]="",r.forEach(function(c,u){n[a]+=e.trim().replace(new RegExp(t,"g"),function(e){return c+e}),u 36 | * 1、 37 | * Getting Started 38 | * 39 | */ 40 | var addSubTitle = function(el,titleLevel){ 41 | var newLine, title, nId; // 获取标题所需要的内容和连接 42 | 43 | title = el.text(); 44 | 45 | // 使用jQuery的guid保证唯一 46 | nId = "gtoc-title-" + ($.guid++);//创建新的hrefID 47 | el.attr("id",nId);// 重新给节点赋值Id 48 | el.addClass("gtoc-header"); 49 | 50 | // 每一行链接的字符串,使用tagName创建层级类名 51 | newLine = 52 | "" + 53 | ""+titleLevel.order+"、" + 54 | title + 55 | ""; 56 | 57 | return newLine; 58 | } 59 | 60 | 61 | /**[Public] 62 | * 内容初始化,构建目录 63 | * @param {[jQuery]} $book 标准的book对象 64 | * @param {[JSON]} config 配置项 e.g. {"el":"h2,h3"} 65 | * 66 | * @return {[String]} 完整的目录字符串 67 | */ 68 | content.init = function($book,config){ 69 | 70 | // 遍历文章主题 71 | var $page = $book.find(".page-inner .normal"); 72 | 73 | // 默认抽取h2,h3标题 74 | // 定义toc字符串的“头部” 75 | var toc = ""; 111 | 112 | return $(toc); // 返回目录结构jQuery对象 113 | } 114 | 115 | return content; 116 | }); -------------------------------------------------------------------------------- /book/mod/elevator.js: -------------------------------------------------------------------------------- 1 | /**[Public] 2 | * 导航电梯功能,可选 3 | * 4 | */ 5 | define([ 6 | "jQuery", 7 | "Mousetrap" 8 | ], function($, Mousetrap){ 9 | 10 | /**[public] 11 | * 根据提供的ID数组 12 | * @param {[Array]} navId 元素ID属性(带#号)数组 13 | * 14 | * @return {[Array]} 返回对应的距离顶部数值 15 | */ 16 | var getTopValue = function(navId,offset){ 17 | var topValueSet = []; 18 | var offset = offset || 0; // 可能需要修正,比如要考虑头部高度 19 | // 循环遍历获取每个条目到顶部的距离值 20 | for(var i = 0;i valueSet[valueSet.length-1]){ 44 | return index+valueSet.length; 45 | }else if(value < valueSet[i] && valueSet[i-1] && value > valueSet[i-1]){ 46 | return index+i; 47 | } 48 | } 49 | } 50 | 51 | /**[public] 52 | * 53 | * 初始化电梯组件 54 | * @param {[jQuery]} $toc 目录对象 55 | * 56 | * @return none 添加scroll事件,完成电梯功能 57 | */ 58 | var init = function($toc) { 59 | 60 | // 所有的标题链接是存储在目录a标签里的 61 | var navId = []; 62 | var menu = $toc.find(".gtoc-menu"); 63 | var link = menu.find("a"); 64 | 65 | var scrollBody = $(".body-inner,.book-body"); 66 | 67 | link.each(function(){ 68 | 69 | var node = $(this); 70 | navId.push(node.attr("href")); 71 | 72 | // 为了防止出现"闪烁"问题,需要修改href属性 73 | node.data("href",node.attr("href")); 74 | node.attr("href","javascript:void(0);"); 75 | }); 76 | // 将所有标题距离顶部的距离放置在topValue数组中 77 | var topValueSet = getTopValue(navId,0); // 后面的数值用于修正 78 | 79 | 80 | // 获取当前点击的Index值 81 | menu.on("click","a",function(){ 82 | var index = link.index(this); // 获取当前链接索引值 83 | // 滚动到目标地址 84 | scrollBody.animate({scrollTop:+topValueSet[index]},'1000',"linear"); 85 | 86 | link.removeClass("state-current"); 87 | $(this).addClass("state-current"); 88 | }); 89 | 90 | // 添加滚动事件,增加电梯 91 | scrollBody.on("scroll",function(){ 92 | // 先清除掉所有的active样式 93 | link.removeClass("state-current"); 94 | // 获取当前滚动条的距离 95 | var topValue = Math.max(scrollBody[0].scrollTop,scrollBody[1].scrollTop);// 获取实际滚动距离 96 | // 根据距离判断应当让哪个导航高亮 97 | var nIndex = getCurrentPos(topValue,topValueSet,40); 98 | $(link[nIndex]).addClass("state-current"); 99 | }); 100 | }; 101 | 102 | 103 | return { 104 | init: init, 105 | getTopValue:getTopValue, 106 | getCurrentPos:getCurrentPos 107 | }; 108 | }); -------------------------------------------------------------------------------- /book/mod/interaction.js: -------------------------------------------------------------------------------- 1 | /**[Public] 2 | * 定义目录的交互,诸如交互、快捷键 3 | * 4 | */ 5 | define([ 6 | "jQuery", 7 | "Mousetrap" 8 | ], function($, Mousetrap){ 9 | // $toc的一些交互 10 | var init = function($toc) { 11 | // 定义快捷键t,收缩/展现目录 12 | Mousetrap.bind(['t'], function(e) { 13 | $toc.toggleClass("state-min"); 14 | return false; 15 | }); 16 | 17 | // 定义快捷键h,显示/隐藏目录 18 | Mousetrap.bind(['h'], function(e) { 19 | $toc.toggleClass("state-hide"); 20 | return false; 21 | }); 22 | 23 | // 点击shrink按钮,改变状态 24 | $toc.find(".j-toggle-menu").on("click",function(){ 25 | $toc.toggleClass("state-min"); 26 | }); 27 | 28 | // 点击回到顶部按钮 29 | $toc.find(".j-scrollup").on("click",function(){ 30 | // 当宽度大于1240时添加动画,body-inner是固定高度的 31 | // 当宽度小于1240时添加动画,body-inner是变高度,book-body是固定高度的 32 | $(".body-inner,.book-body").animate({scrollTop:0},'1000',"linear"); 33 | }); 34 | 35 | // hover的时候更改名字 36 | $toc.find(".gtoc-menu-min .word").mouseenter(function(){ 37 | $(this).parent().addClass("state-hover"); 38 | }).mouseleave(function(){ 39 | $(this).parent().removeClass("state-hover"); 40 | }); 41 | 42 | 43 | // 更改宽口的大小 44 | // console.log($toc.find(".gitbook-table-of-contents").height()); 45 | var height_toc = $toc.find(".gtoc-menu").height(); 46 | 47 | // 当窗口高度小于内容的时候,添加.state-scroll 48 | // 这样目录就能够出现滚动条了 49 | var toggleScroll = function(){ 50 | if($(window).height() < height_toc){ 51 | $toc.addClass("state-scroll"); 52 | }else{ 53 | $toc.removeClass("state-scroll"); 54 | } 55 | } 56 | 57 | // 页面刚载入需要 58 | toggleScroll(); 59 | 60 | // 响应页面伸缩事件 61 | $(window).on("resize",function(){ 62 | toggleScroll(); 63 | }); 64 | 65 | 66 | }; 67 | 68 | return { 69 | init: init 70 | }; 71 | }); -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | book: { 3 | assets: "./book", 4 | js: [ 5 | "gtoc.js" 6 | ], 7 | css: [ 8 | "gtoc.css" 9 | ] 10 | }, 11 | hooks: { 12 | init: function() { 13 | console.log("init!"); 14 | }, 15 | finish: function() { 16 | console.log("finish!"); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /lesshat.less: -------------------------------------------------------------------------------- 1 | // * =========================================================== * 2 | // < LESSHat > 3 | // * =========================================================== * 4 | // 5 | // Made with Energy drinks in Prague, Czech Republic. 6 | // Handcrafted by Petr Brzek, lesshat.com 7 | // Works great with CSS Hat csshat.com 8 | 9 | // version: v3.0.2 (2014-06-26) 10 | 11 | // TABLE OF MIXINS: 12 | // align-content 13 | // align-items 14 | // align-self 15 | // animation 16 | // animation-delay 17 | // animation-direction 18 | // animation-duration 19 | // animation-fill-mode 20 | // animation-iteration-count 21 | // animation-name 22 | // animation-play-state 23 | // animation-timing-function 24 | // appearance 25 | // backface-visibility 26 | // background-clip 27 | // background-image 28 | // background-origin 29 | // background-size 30 | // blur 31 | // border-bottom-left-radius 32 | // border-bottom-right-radius 33 | // border-image 34 | // border-radius 35 | // border-top-left-radius 36 | // border-top-right-radius 37 | // box-shadow 38 | // box-sizing 39 | // brightness 40 | // calc 41 | // column-count 42 | // column-gap 43 | // column-rule 44 | // column-width 45 | // columns 46 | // contrast 47 | // display 48 | // drop-shadow 49 | // filter 50 | // flex 51 | // flex-basis 52 | // flex-direction 53 | // flex-grow 54 | // flex-shrink 55 | // flex-wrap 56 | // font-face 57 | // grayscale 58 | // hue-rotate 59 | // hyphens 60 | // invert 61 | // justify-content 62 | // keyframes 63 | // opacity 64 | // order 65 | // perspective 66 | // perspective-origin 67 | // placeholder 68 | // rotate 69 | // rotate3d 70 | // rotateX 71 | // rotateY 72 | // rotateZ 73 | // saturate 74 | // scale 75 | // scale3d 76 | // scaleX 77 | // scaleY 78 | // scaleZ 79 | // selection 80 | // sepia 81 | // size 82 | // skew 83 | // skewX 84 | // skewY 85 | // transform 86 | // transform-origin 87 | // transform-style 88 | // transition 89 | // transition-delay 90 | // transition-duration 91 | // transition-property 92 | // transition-timing-function 93 | // translate 94 | // translate3d 95 | // translateX 96 | // translateY 97 | // translateZ 98 | // user-select 99 | 100 | .align-content(...) { 101 | @process: ~`(function(r){return r=r||"stretch"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 102 | @process_ms: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t?t="end":"space-between"==t?t="justify":"space-around"==t&&(t="distribute"),t})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 103 | -webkit-align-content: @process; 104 | -ms-flex-line-pack: @process_ms; 105 | align-content: @process; 106 | } 107 | 108 | .align-items(...) { 109 | @process_olderwebkit: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 110 | @process_moz: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 111 | @process: ~`(function(t){return t=t||"stretch"})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 112 | @process_ms: ~`(function(t){return t=t||"stretch","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 113 | -webkit-box-align: @process_olderwebkit; 114 | -moz-box-align: @process_moz; 115 | -webkit-align-items: @process; 116 | -ms-flex-align: @process_ms; 117 | align-items: @process; 118 | } 119 | 120 | .align-self(...) { 121 | @process: ~`(function(t){return t=t||"auto"})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 122 | @process_ms: ~`(function(t){return t=t||"auto","flex-start"==t?t="start":"flex-end"==t&&(t="end"),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 123 | -webkit-align-self: @process; 124 | -ms-flex-item-align: @process_ms; 125 | align-self: @process; 126 | } 127 | 128 | .animation(...) { 129 | @process: ~`(function(t){return t=t||"none",/^[^, ]*,/.test(t)&&(t=t.replace(/(?:,)(?![^(]*\))/g,"")),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 130 | -webkit-animation: @process; 131 | -moz-animation: @process; 132 | -o-animation: @process; 133 | animation: @process; 134 | } 135 | 136 | .animation-delay(...) { 137 | @process: ~`(function(t){t=t||"0";var r=/(?:\d)(?:ms|s)/gi,e=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(t)||"0"===t||(t=t.replace(e,function(t){return t+=parseFloat(t,10)>10?"ms":"s"})),t})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 138 | -webkit-animation-delay: @process; 139 | -moz-animation-delay: @process; 140 | -o-animation-delay: @process; 141 | animation-delay: @process; 142 | } 143 | 144 | .animation-direction(...) { 145 | @process: ~`(function(r){return r||"normal"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 146 | -webkit-animation-direction: @process; 147 | -moz-animation-direction: @process; 148 | -o-animation-direction: @process; 149 | animation-direction: @process; 150 | } 151 | 152 | .animation-duration(...) { 153 | @process: ~`(function(r){r=r||"0";var t=/ms|s/gi,e=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(r)||"0"===r||(r=r.replace(e,function(r){return r+=parseFloat(r,10)>10?"ms":"s"})),r})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 154 | -webkit-animation-duration: @process; 155 | -moz-animation-duration: @process; 156 | -o-animation-duration: @process; 157 | animation-duration: @process; 158 | } 159 | 160 | .animation-fill-mode(...) { 161 | @process: ~`(function(r){return r||"none"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 162 | -webkit-animation-fill-mode: @process; 163 | -moz-animation-fill-mode: @process; 164 | -o-animation-fill-mode: @process; 165 | animation-fill-mode: @process; 166 | } 167 | 168 | .animation-iteration-count(...) { 169 | @process: ~`(function(r){return r||"0"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 170 | -webkit-animation-iteration-count: @process; 171 | -moz-animation-iteration-count: @process; 172 | -o-animation-iteration-count: @process; 173 | animation-iteration-count: @process; 174 | } 175 | 176 | .animation-name(...) { 177 | @process: ~`(function(r){return r||"none"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 178 | -webkit-animation-name: @process; 179 | -moz-animation-name: @process; 180 | -o-animation-name: @process; 181 | animation-name: @process; 182 | } 183 | 184 | .animation-play-state(...) { 185 | @process: ~`(function(r){return r||"running"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 186 | -webkit-animation-play-state: @process; 187 | -moz-animation-play-state: @process; 188 | -o-animation-play-state: @process; 189 | animation-play-state: @process; 190 | } 191 | 192 | .animation-timing-function(...) { 193 | @process: ~`(function(r){return r||"ease"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 194 | -webkit-animation-timing-function: @process; 195 | -moz-animation-timing-function: @process; 196 | -o-animation-timing-function: @process; 197 | animation-timing-function: @process; 198 | } 199 | 200 | .appearance(...) { 201 | @process: ~`(function(r){return r||"none"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 202 | -webkit-appearance: @process; 203 | -moz-appearance: @process; 204 | appearance: @process; 205 | } 206 | 207 | .backface-visibility(...) { 208 | @process: ~`(function(r){return r||"visible"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 209 | -webkit-backface-visibility: @process; 210 | -moz-backface-visibility: @process; 211 | -ms-backface-visibility: @process; 212 | -o-backface-visibility: @process; 213 | backface-visibility: @process; 214 | } 215 | 216 | .background-clip(...) { 217 | @process: ~`(function(r){return r||"border-box"})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 218 | -webkit-background-clip: @process; 219 | -moz-background-clip: @process; 220 | background-clip: @process; 221 | } 222 | 223 | .background-image(...) { 224 | @process_ms: ~`(function(t){function e(t){var e,r,n,a,s,i,u,o,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,f="",d=[];if(!t)return t;do e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),o=e<<16|r<<8|n,a=63&o>>18,s=63&o>>12,i=63&o>>6,u=63&o,d[l++]=g.charAt(a)+g.charAt(s)+g.charAt(i)+g.charAt(u);while(c',svg_start:'',linear_gradient_start:'",radial_gradient_end:"",rect_linear:'',rect_radial:'',svg_end:""};if(r.length){r.forEach(function(t){var e={};if(Object.keys(a).some(function(r){return t.indexOf(r)>=0?(e.svg_direction=a[r],!0):(e.svg_direction=!1,void 0)}),/linear/.test(t))e.svg_type="linear";else if(/radial/.test(t))e.svg_type="radial";else if(!/linear/.test(t)&&!/radial/.test(t))return e.url=t.trim(),e.svg_type="url",e.svg_direction=!0,n.push(e),!1;var r=t.match(/rgb|#[a-zA-Z0-9]|hsl/g).length;e.svg_stops=[],t=t.replace(/transparent/g,"rgba(0,0,0,0)"),t.match(/#[a-zA-Z0-9]/g)&&t.match(/(#[a-zA-Z0-9]+)\s*(\d+%)?/g).forEach(function(t){t=t.split(" "),e.svg_stops.push('')}),t.match(/rgba?\(\d+,\s*\d+,\s*\d+(?:,\s*(0|1|\.\d+|0\.\d+))?\)/g)&&t.replace(/rgba?\((\d+,\s*\d+,\s*\d+)(?:,\s*(0|1|\.\d+|0\.\d+))?\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('')}),t.match(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)/g)&&t.replace(/hsla?\((\d+,\s*\d+%,\s*\d+%),\s*(0|1|\.\d+|0\.\d+)\)\s*(\d+%)?/g,function(t,r,n,a){e.svg_stops.push('')});var s=Math.floor(100/(r-1));e.svg_stops.forEach(function(t,r){/offset="false"/.test(t)&&(e.svg_stops[r]=t.replace(/offset="false"/,'offset="'+s*r+'%"'))}),e.svg_stops.sort(function(t,e){return t=t.match(/offset="(\d+)%"/),e=e.match(/offset="(\d+)%"/),2==t.length&&2==e.length?t[1]-e[1]:void 0}),n.push(e)});var i=[],u=n.every(function(t){for(var e in t)if(0==t[e]||0==t[e].length)return!1;return!0});if(!u)return 8121991;n.forEach(function(t,e){("linear"==t.svg_type||"radial"==t.svg_type)&&(i[e]=s.xml+s.svg_start),"linear"==t.svg_type?(i[e]+=s.linear_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.linear_gradient_end,i[e]+=s.rect_linear,i[e]+=s.svg_end):"radial"==t.svg_type?(i[e]+=s.radial_gradient_start+" "+t.svg_direction+">",t.svg_stops.forEach(function(t){i[e]+=t}),i[e]+=s.radial_gradient_end,i[e]+=s.rect_radial,i[e]+=s.svg_end):"url"==t.svg_type&&(i[e]=t.url)}),i.forEach(function(t,r){/<\?xml version="1.0" \?>/g.test(t)&&(i[r]=s.uri_data+e(t)+")")}),t=i.join(",")}return t})((function(){var r="@{arguments}";return r=r.replace(/^\[|\]$/g,"")})())`; 225 | @process_webkit: ~`(function(t){if(t=t||8121991,8121991==t)return t;var e={"to bottom":"top","to left":"right","to top":"bottom","to right":"left","ellipse at center":"center, ellipse cover","circle closest-side":"center center, circle contain","circle farthest-corner":"center center, circle cover","circle farthest-side":"center center, circle cover","ellipse closest-side":"center center, ellipse contain","ellipse farthest-corner":"center center, ellipse cover","ellipse farthest-side":"center center, ellipse cover"},r=/(radial-gradient\()([a-z- ]+)at\s+(\w+%?)\s*(\w*%?)/g,n=Object.keys(e);return n.some(function(n){return t.indexOf(n)>=0?(t=t.replace(new RegExp(n+"(?![ a-z0-9])","g"),e[n]),!0):(r.test(t)&&(t=t.replace(r,function(t,e,r,n,a){return e.trim()+n.trim()+" "+a.trim()+","+r.replace(/closest-side/g,"contain").replace(/farthest-corner/g,"cover").trim()})),void 0)}),t=t.replace(/(\d+)\s*deg/g,function(t,e){return 90-e+"deg"}).replace(/(linear|radial)-gradient/g,"-webkit-$1-gradient")})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 226 | @process_moz: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t={"to bottom":"top","to left":"right","to top":"bottom","to right":"left","ellipse at center":"center, ellipse cover","circle closest-side":"center center, circle contain","circle farthest-corner":"center center, circle cover","circle farthest-side":"center center, circle cover","ellipse closest-side":"center center, ellipse contain","ellipse farthest-corner":"center center, ellipse cover","ellipse farthest-side":"center center, ellipse cover"},r=/(radial-gradient\()([a-z- ]+)at\s+(\w+%?)\s*(\w*%?)/g,n=Object.keys(t);return n.some(function(n){return e.indexOf(n)>=0?(e=e.replace(new RegExp(n+"(?![ a-z0-9])","g"),t[n]),!0):(r.test(e)&&(e=e.replace(r,function(e,t,r,n,a){return t.trim()+n.trim()+" "+a.trim()+","+r.replace(/closest-side/g,"contain").replace(/farthest-corner/g,"cover").trim()})),void 0)}),e=e.replace(/(\d+)\s*deg/g,function(e,t){return 90-t+"deg"}).replace(/(linear|radial)-gradient/g,"-moz-$1-gradient")})((function(){var t="@{arguments}";return t=t.replace(/^\[|\]$/g,"")})())`; 227 | @process_opera: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t={"to bottom":"top","to left":"right","to top":"bottom","to right":"left","ellipse at center":"center, ellipse cover","circle closest-side":"center center, circle contain","circle farthest-corner":"center center, circle cover","circle farthest-side":"center center, circle cover","ellipse closest-side":"center center, ellipse contain","ellipse farthest-corner":"center center, ellipse cover","ellipse farthest-side":"center center, ellipse cover"},r=/(radial-gradient\()([a-z- ]+)at\s+(\w+%?)\s*(\w*%?)/g,n=Object.keys(t);return n.some(function(n){return e.indexOf(n)>=0?(e=e.replace(new RegExp(n+"(?![ a-z0-9])","g"),t[n]),!0):(r.test(e)&&(e=e.replace(r,function(e,t,r,n,a){return t.trim()+n.trim()+" "+a.trim()+","+r.replace(/closest-side/g,"contain").replace(/farthest-corner/g,"cover").trim()})),void 0)}),e=e.replace(/(\d+)\s*deg/g,function(e,t){return 90-t+"deg"}).replace(/(linear|radial)-gradient/g,"-o-$1-gradient")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 228 | @process: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t={top:"to bottom",right:"to left",bottom:"to top",left:"to right"},r=Object.keys(t);return r.some(function(r){return e.indexOf(r)>=0&&!new RegExp("to\\s+"+r+"|at\\s+"+r,"g").test(e)?(e=e.replace(new RegExp(r),t[r]),!0):void 0}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 229 | background-image: @process_ms; 230 | background-image: @process_webkit; 231 | background-image: @process_moz; 232 | background-image: @process_opera; 233 | background-image: @process; 234 | } 235 | 236 | .background-origin(...) { 237 | @process: ~`(function(e){return e||"padding-box"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 238 | -webkit-background-origin: @process; 239 | -moz-background-origin: @process; 240 | background-origin: @process; 241 | } 242 | 243 | .background-size(...) { 244 | @process: ~`(function(e){e=e||"auto auto";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 245 | -webkit-background-size: @process; 246 | -moz-background-size: @process; 247 | background-size: @process; 248 | } 249 | 250 | .blur(...) { 251 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 252 | -webkit-filter: blur(@process); 253 | -moz-filter: blur(@process); 254 | -ms-filter: blur(@process); 255 | filter: blur(@process); 256 | } 257 | 258 | .border-bottom-left-radius(...) { 259 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 260 | -webkit-border-bottom-left-radius: @process; -webkit-background-clip: padding-box; 261 | -moz-border-radius-bottomleft: @process; -moz-background-clip: padding; 262 | border-bottom-left-radius: @process; background-clip: padding-box; 263 | } 264 | 265 | .border-bottom-right-radius(...) { 266 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 267 | -webkit-border-bottom-right-radius: @process; -webkit-background-clip: padding-box; 268 | -moz-border-radius-bottomright: @process; -moz-background-clip: padding; 269 | border-bottom-right-radius: @process; background-clip: padding-box; 270 | } 271 | 272 | .border-image(...) { 273 | @process: ~`(function(e){return e=e||8121991,/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 274 | -webkit-border-image: @process; 275 | -moz-border-image: @process; 276 | -o-border-image: @process; 277 | border-image: @process; 278 | } 279 | 280 | .border-radius(...) { 281 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 282 | -webkit-border-radius: @process; -webkit-background-clip: padding-box; 283 | -moz-border-radius: @process; -moz-background-clip: padding; 284 | border-radius: @process; background-clip: padding-box; 285 | } 286 | 287 | .border-top-left-radius(...) { 288 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 289 | -webkit-border-top-left-radius: @process; -webkit-background-clip: padding-box; 290 | -moz-border-radius-topleft: @process; -moz-background-clip: padding; 291 | border-top-left-radius: @process; background-clip: padding-box; 292 | } 293 | 294 | .border-top-right-radius(...) { 295 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 296 | -webkit-border-top-right-radius: @process; -webkit-background-clip: padding-box; 297 | -moz-border-radius-topright: @process; -moz-background-clip: padding; 298 | border-top-right-radius: @process; background-clip: padding-box; 299 | } 300 | 301 | .box-shadow(...) { 302 | @process: ~`(function(e){e=e||"0";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 303 | -webkit-box-shadow: @process; 304 | -moz-box-shadow: @process; 305 | box-shadow: @process; 306 | } 307 | 308 | .box-sizing(...) { 309 | @process: ~`(function(e){return e=e||"content-box"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 310 | -webkit-box-sizing: @process; 311 | -moz-box-sizing: @process; 312 | box-sizing: @process; 313 | } 314 | 315 | .brightness(...) { 316 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 317 | -webkit-filter: brightness(@process); 318 | -moz-filter: brightness(@process); 319 | -ms-filter: brightness(@process); 320 | filter: brightness(@process); 321 | } 322 | 323 | .calc(...) { 324 | @process: ~`(function(e){function t(t,r){var a=");\n",c=n.split(","),i=c[0]+":"+t+"("+(c[1].trim()||0)+a;"start"==r?e="0;\n"+i:e+=i}e=e||8121991;var r="@{state}",n=e;if(8121991==e)return e;switch(r){case"1":t("-webkit-calc","start"),t("-moz-calc"),t("calc");break;case"2":t("-webkit-calc","start"),t("-moz-calc");break;case"3":t("-webkit-calc","start"),t("calc");break;case"4":t("-webkit-calc","start");break;case"5":t("-moz-calc","start"),t("calc");break;case"6":t("-moz-calc","start");break;case"7":t("calc","start")}return e=e.replace(/;$/g,"")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 325 | @state: 1; -lh-property: @process; 326 | 327 | } 328 | 329 | .column-count(...) { 330 | @process: ~`(function(e){return e=e||"auto"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 331 | -webkit-column-count: @process; 332 | -moz-column-count: @process; 333 | column-count: @process; 334 | } 335 | 336 | .column-gap(...) { 337 | @process: ~`(function(e){e=e||"normal";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 338 | -webkit-column-gap: @process; 339 | -moz-column-gap: @process; 340 | column-gap: @process; 341 | } 342 | 343 | .column-rule(...) { 344 | @process: ~`(function(e){e=e||"medium none black";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 345 | -webkit-column-rule: @process; 346 | -moz-column-rule: @process; 347 | column-rule: @process; 348 | } 349 | 350 | .column-width(...) { 351 | @process: ~`(function(e){e=e||"auto";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 352 | -webkit-column-width: @process; 353 | -moz-column-width: @process; 354 | column-width: @process; 355 | } 356 | 357 | .columns(...) { 358 | @process: ~`(function(e){e=e||"auto auto";var t=/^\d+$/;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,""),e=e.split(" ")),t.test(e[0])&&(e[0]=e[0]+"px"),e.join(" ")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 359 | -webkit-columns: @process; 360 | -moz-columns: @process; 361 | columns: @process; 362 | } 363 | 364 | .contrast(...) { 365 | @process: ~`(function(e){e=e||"100%";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 366 | -webkit-filter: ~"contrast(@{process})"; 367 | -moz-filter: ~"contrast(@{process})"; 368 | -ms-filter: ~"contrast(@{process})"; 369 | filter: ~"contrast(@{process})"; 370 | } 371 | 372 | .display(...) { 373 | @process_oldwebkit: ~`(function(e){return e="flex"==e||"inline-flex"==e?"-webkit-box":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 374 | @process_moz: ~`(function(e){return e="flex"==e||"inline-flex"==e?"-moz-box":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 375 | @process_webkit: ~`(function(e){return e="flex"==e||"inline-flex"==e?"-webkit-"+e:8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 376 | @process_ms: ~`(function(e){return e="flex"==e?"-ms-flexbox":"inline-flex"==e?"-ms-inline-flexbox":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 377 | @process: ~`(function(e){return"flex"!=e&&"inline-flex"!=e&&(e=8121991),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 378 | display: @process_oldwebkit; 379 | display: @process_moz; 380 | display: @process_webkit; 381 | display: @process_ms; 382 | display: @process; 383 | } 384 | 385 | .drop-shadow(...) { 386 | @process: ~`(function(e){if(e=e||8121991,8121991==e)return e;var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 387 | -webkit-filter: drop-shadow(@process); 388 | -moz-filter: drop-shadow(@process); 389 | -ms-filter: drop-shadow(@process); 390 | filter: drop-shadow(@process); 391 | } 392 | 393 | .filter(...) { 394 | @process: ~`(function(e){return e=e||"none",/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 395 | -webkit-filter: @process; 396 | -moz-filter: @process; 397 | -ms-filter: @process; 398 | filter: @process; 399 | } 400 | 401 | .flex(...) { 402 | @process_olderwebkit: ~`(function(e){return/^\d+/.test(e)?e=e.match(/^\d+/)[0]:""==e&&(e="0"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 403 | @process_moz: ~`(function(e){return/^\d+/.test(e)?e=e.match(/^\d+/)[0]:""==e&&(e="0"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 404 | @process: ~`(function(e){return e=e||"0 1 auto",/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 405 | -webkit-box-flex: @process_olderwebkit; 406 | -moz-box-flex: @process_moz; 407 | -webkit-flex: @process; 408 | -ms-flex: @process; 409 | flex: @process; 410 | } 411 | 412 | .flex-basis(...) { 413 | @process: ~`(function(e){e=e||"auto";var t=/\d/gi,r=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return t.test(e)&&(e=e.replace(r,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 414 | -webkit-flex-basis: @process; 415 | flex-basis: @process; 416 | } 417 | 418 | .flex-direction(...) { 419 | @process_oldestwebkit: ~`(function(e){return e="row"==e||"column"==e?"normal":"row-reverse"==e||"column-reverse"==e?"reverse":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 420 | @process_oldermoz: ~`(function(e){return e="row"==e||"column"==e?"normal":"row-reverse"==e||"column-reverse"==e?"reverse":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 421 | @process_olderwebkit: ~`(function(e){return e="row"==e||"row-reverse"==e?"horizontal":"column"==e||"column-reverse"==e?"vertical":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 422 | @process_moz: ~`(function(e){return e="row"==e||"row-reverse"==e?"horizontal":"column"==e||"column-reverse"==e?"vertical":8121991})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 423 | @process: ~`(function(e){return e=e||"row"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 424 | -webkit-box-direction: @process_oldestwebkit; 425 | -moz-box-direction: @process_oldermoz; 426 | -webkit-box-orient: @process_olderwebkit; 427 | -moz-box-orient: @process_moz; 428 | -webkit-flex-direction: @process; 429 | -ms-flex-direction: @process; 430 | flex-direction: @process; 431 | } 432 | 433 | .flex-grow(...) { 434 | @process: ~`(function(e){return e=e||"0"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 435 | -webkit-flex-grow: @process; 436 | flex-grow: @process; 437 | } 438 | 439 | .flex-shrink(...) { 440 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 441 | -webkit-flex-shrink: @process; 442 | flex-shrink: @process; 443 | } 444 | 445 | .flex-wrap(...) { 446 | @process: ~`(function(e){return e=e||"nowrap"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 447 | -webkit-flex-wrap: @process; 448 | -ms-flex-wrap: @process; 449 | flex-wrap: @process; 450 | } 451 | 452 | .font-face(@fontname, @fontfile, @fontweight:normal, @fontstyle:normal) { 453 | font-family: "@{fontname}"; 454 | src: url("@{fontfile}.eot"); 455 | src: url("@{fontfile}.eot?#iefix") format("embedded-opentype"), 456 | url("@{fontfile}.woff") format("woff"), 457 | url("@{fontfile}.ttf") format("truetype"), 458 | url("@{fontfile}.svg#@{fontname}") format("svg"); 459 | font-weight: @fontweight; 460 | font-style: @fontstyle; 461 | } 462 | 463 | .grayscale(...) { 464 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 465 | -webkit-filter: grayscale(@process); 466 | -moz-filter: grayscale(@process); 467 | -ms-filter: grayscale(@process); 468 | filter: grayscale(@process); 469 | } 470 | 471 | .hue-rotate(...) { 472 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 473 | -webkit-filter: hue-rotate(@process); 474 | -moz-filter: hue-rotate(@process); 475 | -ms-filter: hue-rotate(@process); 476 | filter: hue-rotate(@process); 477 | } 478 | 479 | .hyphens(...) { 480 | @process: ~`(function(e){return e=e||"manual"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 481 | -webkit-hyphens: @process; 482 | -moz-hyphens: @process; 483 | -ms-hyphens: @process; 484 | hyphens: @process; 485 | } 486 | 487 | .invert(...) { 488 | @process: ~`(function(e){e=e||"100%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 489 | -webkit-filter: invert(@process); 490 | -moz-filter: invert(@process); 491 | -ms-filter: invert(@process); 492 | filter: invert(@process); 493 | } 494 | 495 | .justify-content(...) { 496 | @process_oldestWebkit: ~`(function(e){return e=e||"start","flex-start"==e?e="start":"flex-end"==e?e="end":("space-between"==e||"space-around"==e)&&(e="justify"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 497 | @process_moz: ~`(function(e){return e=e||"start","flex-start"==e?e="start":"flex-end"==e?e="end":("space-between"==e||"space-around"==e)&&(e="justify"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 498 | @process_ms: ~`(function(e){return e=e||"start","flex-start"==e?e="start":"flex-end"==e?e="end":"space-between"==e?e="justify":"space-around"==e&&(e="distribute"),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 499 | @process: ~`(function(e){return e=e||"flex-start"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 500 | -webkit-box-pack: @process_oldestWebkit; 501 | -moz-box-pack: @process_moz; 502 | -ms-flex-pack: @process_ms; 503 | -webkit-justify-content: @process; 504 | justify-content: @process; 505 | } 506 | 507 | .keyframes(...) { 508 | @process: ~`(function(e){function r(r,t,c){var i="}\n",u=n.split(/(^[a-zA-Z0-9-]+),/g),s=t+" "+u[1]+"{",o=["-webkit-","-moz-","-ms-",""];c?a.forEach(function(r){-1!==e.indexOf(r)&&(u[2]=u[2].replace(new RegExp(r,"g"),function(e){return c+e}))}):u[2]=u[2].replace(/{([^}]+)}/g,function(e,r){var t=r.split(";");t.forEach(function(e,r){a.forEach(function(n){-1!==e.indexOf(n)&&(t[r]="",o.forEach(function(a){t[r]+=e.trim().replace(new RegExp(n,"g"),function(e){return a+e})+";"}))})});var n=t.join(";").replace(/;;/g,";");return e.replace(r,n)}),s+=u[2]+i,"start"==r?e="0; } \n"+s:"startend"==r?e="0; } \n"+s.replace(i,""):e+="end"==r?s.replace(i,""):s}e=e||8121991;var t="@{state}",n=e;if(8121991==e)return e;var a=["animation","transform","filter"];switch(t){case"1":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-moz-keyframes","-moz-"),r(null,"@-o-keyframes","-o-"),r("end","@keyframes");break;case"2":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-moz-keyframes","-moz-"),r("end","@keyframes");break;case"3":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-moz-keyframes","-moz-"),r("end","@-o-keyframes","-o-");break;case"4":r("start","@-webkit-keyframes","-webkit-"),r(null,"@-o-keyframes","-o-"),r("end","@keyframes");break;case"5":r("start","@-webkit-keyframes","-webkit-"),r("end","@-moz-keyframes","-moz-");break;case"6":r("start","@-webkit-keyframes","-webkit-"),r("end","@-o-keyframes","-o-");break;case"7":r("start","@-webkit-keyframes","-webkit-"),r("end","@keyframes");break;case"8":r("startend","@-webkit-keyframes","-webkit-");break;case"9":r("start","@-moz-keyframes","-moz-"),r(null,"@-o-keyframes","-o-"),r("end","@keyframes");break;case"10":r("start","@-moz-keyframes","-moz-"),r("end","@-o-keyframes","-o-");break;case"11":r("start","@-moz-keyframes","-moz-"),r("end","@keyframes");break;case"12":r("startend","@-moz-keyframes","-moz-");break;case"13":r("start","@-o-keyframes","-o-"),r("end","@keyframes");break;case"14":r("startend","@-o-keyframes","-o-");break;case"15":r("startend","@keyframes")}return e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 509 | @state: 1; lesshat-selector { -lh-property: @process; } 510 | 511 | 512 | 513 | } 514 | 515 | .opacity(...) { 516 | @process_ms: ~`(function(e){return e=e||"filter: alpha(opacity=100)","alpha(opacity="+Math.floor(100*e)+")"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 517 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 518 | zoom: 1; filter: @process_ms; 519 | -webkit-opacity: @process; 520 | -moz-opacity: @process; 521 | opacity: @process; 522 | } 523 | 524 | .order(...) { 525 | @process: ~`(function(e){return e=e||"0"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 526 | -webkit-box-ordinal-group: @process; 527 | -moz-box-ordinal-group: @process; 528 | -ms-flex-order: @process; 529 | -webkit-order: @process; 530 | order: @process; 531 | } 532 | 533 | .perspective(...) { 534 | @process: ~`(function(e){e=e||"none";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"px"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 535 | -webkit-perspective: @process; 536 | -moz-perspective: @process; 537 | perspective: @process; 538 | } 539 | 540 | .perspective-origin(...) { 541 | @process: ~`(function(e){e=e||"50% 50%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 542 | -webkit-perspective-origin: @process; 543 | -moz-perspective-origin: @process; 544 | perspective-origin: @process; 545 | } 546 | 547 | .placeholder(@color:#aaa, @element: 08121991) { 548 | .inception (@arguments) when not (@element = 08121991) { 549 | @{element}::-webkit-input-placeholder { 550 | color: @color; 551 | } 552 | @{element}:-moz-placeholder { 553 | color: @color; 554 | } 555 | @{element}::-moz-placeholder { 556 | color: @color; 557 | } 558 | @{element}:-ms-input-placeholder { 559 | color: @color; 560 | } 561 | } 562 | .inception (@arguments) when (@element = 08121991) { 563 | &::-webkit-input-placeholder { 564 | color: @color; 565 | } 566 | &:-moz-placeholder { 567 | color: @color; 568 | } 569 | &::-moz-placeholder { 570 | color: @color; 571 | } 572 | &:-ms-input-placeholder { 573 | color: @color; 574 | } 575 | } 576 | .inception(@arguments); 577 | } 578 | 579 | .rotate(...) { 580 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 581 | -webkit-transform: rotate(@process); 582 | -moz-transform: rotate(@process); 583 | -ms-transform: rotate(@process); 584 | -o-transform: rotate(@process); 585 | transform: rotate(@process); 586 | } 587 | 588 | .rotate3d(...) { 589 | @process: ~`(function(e){return e=e||"0, 0, 0, 0",e=e.replace(/,\s*\d+$/,function(e){return e+"deg"})})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 590 | -webkit-transform: rotate3d(@process); 591 | -moz-transform: rotate3d(@process); 592 | -ms-transform: rotate3d(@process); 593 | -o-transform: rotate3d(@process); 594 | transform: rotate3d(@process); 595 | } 596 | 597 | .rotateX(...) { 598 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 599 | -webkit-transform: rotateX(@process); 600 | -moz-transform: rotateX(@process); 601 | -ms-transform: rotateX(@process); 602 | -o-transform: rotateX(@process); 603 | transform: rotateX(@process); 604 | } 605 | 606 | .rotateY(...) { 607 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 608 | -webkit-transform: rotateY(@process); 609 | -moz-transform: rotateY(@process); 610 | -ms-transform: rotateY(@process); 611 | -o-transform: rotateY(@process); 612 | transform: rotateY(@process); 613 | } 614 | 615 | .rotateZ(...) { 616 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 617 | -webkit-transform: rotateZ(@process); 618 | -moz-transform: rotateZ(@process); 619 | -ms-transform: rotateZ(@process); 620 | -o-transform: rotateZ(@process); 621 | transform: rotateZ(@process); 622 | } 623 | 624 | .saturate(...) { 625 | @process: ~`(function(e){e=e||"100%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 626 | -webkit-filter: ~"saturate(@{process})"; 627 | -moz-filter: ~"saturate(@{process})"; 628 | -ms-filter: ~"saturate(@{process})"; 629 | filter: ~"saturate(@{process})"; 630 | } 631 | 632 | .scale(...) { 633 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 634 | -webkit-transform: scale(@process); 635 | -moz-transform: scale(@process); 636 | -ms-transform: scale(@process); 637 | -o-transform: scale(@process); 638 | transform: scale(@process); 639 | } 640 | 641 | .scale3d(...) { 642 | @process: ~`(function(e){return e=e||"1, 1, 1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 643 | -webkit-transform: scale3d(@process); 644 | -moz-transform: scale3d(@process); 645 | -ms-transform: scale3d(@process); 646 | -o-transform: scale3d(@process); 647 | transform: scale3d(@process); 648 | } 649 | 650 | .scaleX(...) { 651 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 652 | -webkit-transform: scaleX(@process); 653 | -moz-transform: scaleX(@process); 654 | -ms-transform: scaleX(@process); 655 | -o-transform: scaleX(@process); 656 | transform: scaleX(@process); 657 | } 658 | 659 | .scaleY(...) { 660 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 661 | -webkit-transform: scaleY(@process); 662 | -moz-transform: scaleY(@process); 663 | -ms-transform: scaleY(@process); 664 | -o-transform: scaleY(@process); 665 | transform: scaleY(@process); 666 | } 667 | 668 | .scaleZ(...) { 669 | @process: ~`(function(e){return e=e||"1"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 670 | -webkit-transform: scaleZ(@process); 671 | -moz-transform: scaleZ(@process); 672 | -ms-transform: scaleZ(@process); 673 | -o-transform: scaleZ(@process); 674 | transform: scaleZ(@process); 675 | } 676 | 677 | .selection(...) { 678 | @process: ~`(function(e){function r(r,t){var a="}\n",c=n.split(","),u=(c[1]||"")+t+"{"+c[0]+a;"start"==r?e="0; } \n"+u:"startend"==r?e="0; } \n"+u.replace(a,""):e+="end"==r?u.replace(a,""):u}e=e||8121991;var t="@{state}",n=e;if(8121991==e)return e;switch(t){case"1":r("start","::selection"),r("end","::-moz-selection");break;case"2":r("startend","::selection");break;case"3":r("startend","::-moz-selection")}return e=e.replace(/;$/g,"")})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 679 | @state: 1; lesshat-selector { -lh-property: @process; } 680 | 681 | } 682 | 683 | .sepia(...) { 684 | @process: ~`(function(e){e=e||"100%";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 685 | -webkit-filter: sepia(@process); 686 | -moz-filter: sepia(@process); 687 | -ms-filter: sepia(@process); 688 | filter: sepia(@process); 689 | } 690 | 691 | .size(@square) { 692 | @unit: 'px'; 693 | .process(@square) when (ispixel(@square)), (isem(@square)), (ispercentage(@square)), (iskeyword(@square)) { 694 | width: @square; 695 | height: @square; 696 | } 697 | 698 | .process(@square) when not (ispixel(@square)) and not (isem(@square)) and not (ispercentage(@square)) and not (isstring(@square)) and not (iskeyword(@square)) { 699 | width: ~`@{square} + @{unit}`; 700 | height: ~`@{square} + @{unit}`; 701 | } 702 | 703 | .process(@square); 704 | 705 | } 706 | 707 | .size(@width, @height) { 708 | @unit: 'px'; 709 | .process(@width, @height) when (ispixel(@width)), (isem(@width)), (ispercentage(@width)), (iskeyword(@width)) { 710 | .kittens(@height) when (ispixel(@height)), (isem(@height)), (ispercentage(@height)), (iskeyword(@height)) { 711 | width: @width; 712 | height: @height; 713 | } 714 | .kittens(@height) when not (ispixel(@height)) and not (isem(@height)) and not (ispercentage(@height)) and not (iskeyword(@height)) { 715 | width: @width; 716 | height: ~`@{height} + @{unit}`; 717 | } 718 | .kittens(@height); 719 | } 720 | 721 | .process(@width, @height) when (ispixel(@height)), (isem(@height)), (ispercentage(@height)), (iskeyword(@height)) { 722 | .kittens(@width) when (ispixel(@width)), (isem(@width)), (ispercentage(@width)), (iskeyword(@width)) {} 723 | .kittens(@width) when not (ispixel(@width)) and not (isem(@width)) and not (ispercentage(@width)) and not (iskeyword(@width)) { 724 | width: ~`@{width} + @{unit}`; 725 | height: @height; 726 | } 727 | .kittens(@width); 728 | } 729 | 730 | .process(@width, @height) when not (ispixel(@width)) and not (isem(@width)) and not (ispercentage(@width)) and not (iskeyword(@width)) and not (ispixel(@height)) and not (isem(@height)) and not (ispercentage(@height)) and not (iskeyword(@height)) { 731 | width: ~`@{width} + @{unit}`; 732 | height: ~`@{height} + @{unit}`; 733 | } 734 | 735 | .process(@width, @height); 736 | 737 | } 738 | 739 | .skew(...) { 740 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 741 | -webkit-transform: skew(@process); 742 | -moz-transform: skew(@process); 743 | -ms-transform: skew(@process); 744 | -o-transform: skew(@process); 745 | transform: skew(@process); 746 | } 747 | 748 | .skewX(...) { 749 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 750 | -webkit-transform: skewX(@process); 751 | -moz-transform: skewX(@process); 752 | -ms-transform: skewX(@process); 753 | -o-transform: skewX(@process); 754 | transform: skewX(@process); 755 | } 756 | 757 | .skewY(...) { 758 | @process: ~`(function(e){e=e||"0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"deg"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 759 | -webkit-transform: skewY(@process); 760 | -moz-transform: skewY(@process); 761 | -ms-transform: skewY(@process); 762 | -o-transform: skewY(@process); 763 | transform: skewY(@process); 764 | } 765 | 766 | .transform(...) { 767 | @process: ~`(function(e){e=e||"none";var r={translate:"px",rotate:"deg",rotate3d:"deg",skew:"deg"};/^\w*\(?[a-z0-9.]*\)?/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,""));for(var t in r)e.indexOf(t)>=0&&(e=e.replace(new RegExp(t+"[\\w]?\\([a-z0-9, %]*\\)"),function(e){var n=/(\d+\.?\d*)(?!\w|%)/g;return"rotate3d"==t&&(n=/,\s*\d+$/),e.replace(n,function(e){return e+r[t]})}));return e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 768 | -webkit-transform: @process; 769 | -moz-transform: @process; 770 | -ms-transform: @process; 771 | -o-transform: @process; 772 | transform: @process; 773 | } 774 | 775 | .transform-origin(...) { 776 | @process: ~`(function(e){e=e||"50% 50% 0";var r=/\d/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.test(e)&&(e=e.replace(t,function(e){return 0==e&&e||e+"%"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 777 | -webkit-transform-origin: @process; 778 | -moz-transform-origin: @process; 779 | -ms-transform-origin: @process; 780 | -o-transform-origin: @process; 781 | transform-origin: @process; 782 | } 783 | 784 | .transform-style(...) { 785 | @process: ~`(function(e){return e=e||"flat"})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 786 | -webkit-transform-style: @process; 787 | -moz-transform-style: @process; 788 | -ms-transform-style: @process; 789 | -o-transform-style: @process; 790 | transform-style: @process; 791 | } 792 | 793 | .transition(...) { 794 | @process_webkit: ~`(function(e){e=e||"all 0 ease 0";var r=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],t="-webkit-",n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),n.test(e)||"0"===e||(e=e.replace(a,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 795 | @process_moz: ~`(function(e){e=e||"all 0 ease 0";var r=["background-size","box-shadow","column","transform","filter"],t="-moz-",n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),n.test(e)||"0"===e||(e=e.replace(a,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 796 | @process_opera: ~`(function(e){e=e||"all 0 ease 0";var r=["transform"],t="-o-",n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;return/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,"")),r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),n.test(e)||"0"===e||(e=e.replace(a,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 797 | @process: ~`(function(e){e=e||"all 0 ease 0";var r=["-webkit-","-moz-","-o-",""],t=["column","transform","filter"],n=/(?:\d)(?:ms|s)/gi,a=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%)/gi;/^[^, ]*,/.test(e)&&(e=e.replace(/(?:,)(?![^(]*\))/g,""));var c=e.split(/(?:,)(?![^(]*\))/g);return c.forEach(function(e,n){t.forEach(function(t){-1!==e.indexOf(t)&&(c[n]="",r.forEach(function(a,u){c[n]+=e.trim().replace(new RegExp(t,"g"),function(e){return a+e}),u10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 798 | -webkit-transition: @process_webkit; 799 | -moz-transition: @process_moz; 800 | -o-transition: @process_opera; 801 | transition: @process; 802 | } 803 | 804 | .transition-delay(...) { 805 | @process: ~`(function(e){e=e||"0";var r=/(?:\d)(?:ms|s)/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)||"0"===e||(e=e.replace(t,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 806 | -webkit-transition-delay: @process; 807 | -moz-transition-delay: @process; 808 | -o-transition-delay: @process; 809 | transition-delay: @process; 810 | } 811 | 812 | .transition-duration(...) { 813 | @process: ~`(function(e){e=e||"0";var r=/ms|s/gi,t=/(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;return r.test(e)||"0"===e||(e=e.replace(t,function(e){return e+=parseFloat(e,10)>10?"ms":"s"})),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 814 | -webkit-transition-duration: @process; 815 | -moz-transition-duration: @process; 816 | -o-transition-duration: @process; 817 | transition-duration: @process; 818 | } 819 | 820 | .transition-property(...) { 821 | @process_webkit: ~`(function(e){e=e||"all";var r=["background-size","border-radius","border-bottom-left-radius","border-bottom-right-radius","border-top-left-radius","border-top-right-radius","box-shadow","column","transform","filter"],t="-webkit-";return r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 822 | @process_moz: ~`(function(e){e=e||"all";var r=["background-size","box-shadow","column","transform","filter"],t="-moz-";return r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 823 | @process_opera: ~`(function(e){e=e||"all";var r=["transform"],t="-o-";return r.forEach(function(r){-1!==e.indexOf(r)&&(e=e.replace(new RegExp(r,"g"),function(e){return t+e}))}),e})((function(){var e="@{arguments}";return e=e.replace(/^\[|\]$/g,"")})())`; 824 | @process: ~`(function(e){e=e||"all";var r=["-webkit-","-moz-","-o-",""],t=["column","transform","filter"],n=e.split(/(?:,)(?![^(]*\))/g);return n.forEach(function(e,a){t.forEach(function(t){-1!==e.indexOf(t)&&(n[a]="",r.forEach(function(c,u){n[a]+=e.trim().replace(new RegExp(t,"g"),function(e){return c+e}),u (D:\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:308:14) 90 | 42 error at Request._callback (D:\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:246:65) 91 | 42 error at Request.self.callback (D:\nodejs\node_modules\npm\node_modules\request\request.js:236:22) 92 | 42 error at Request.emit (events.js:98:17) 93 | 42 error at Request. (D:\nodejs\node_modules\npm\node_modules\request\request.js:1142:14) 94 | 42 error at Request.emit (events.js:117:20) 95 | 42 error at IncomingMessage. (D:\nodejs\node_modules\npm\node_modules\request\request.js:1096:12) 96 | 42 error at IncomingMessage.emit (events.js:117:20) 97 | 42 error at _stream_readable.js:943:16 98 | 42 error at process._tickCallback (node.js:419:13) 99 | 43 error If you need help, you may report this *entire* log, 100 | 43 error including the npm and node versions, at: 101 | 43 error 102 | 44 error System Windows_NT 6.1.7601 103 | 45 error command "D:\\nodejs\\\\node.exe" "D:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "publish" 104 | 46 error cwd C:\Users\bocheng.zbc\AppData\Roaming\npm\node_modules\gitbook\node_modules\gitbook-plugin-gtoc 105 | 47 error node -v v0.10.33 106 | 48 error npm -v 1.4.28 107 | 49 verbose exit [ 1, true ] 108 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gitbook-plugin-gtoc", 3 | "description": "Get content of Gitbook", 4 | "main": "index.js", 5 | "version": "0.2.0", 6 | "engines": { 7 | "gitbook": "*" 8 | }, 9 | "homepage": "https://github.com/boycgit/gitbook-plugin-gtoc", 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/boycgit/gitbook-plugin-gtoc.git" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/boycgit/gitbook-plugin-gtoc/issues" 16 | }, 17 | "license": "Apache 2" 18 | } 19 | --------------------------------------------------------------------------------