Skip to content

Commit

Permalink
Add simple lesshint support
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 26, 2015
1 parent 8a1736c commit 8d36dc6
Show file tree
Hide file tree
Showing 47 changed files with 290 additions and 194 deletions.
12 changes: 12 additions & 0 deletions .lesshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"propertyOrdering": false,
"hexLength": "short",
"stringQuotes": false,
"decimalZero": false,
"importantRule": false,
"zeroUnit": "no_unit",
"qualifyingElement": false,
"duplicateProperty": false,
"importPath": false,
"finalNewline": false
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"eslint": "^1.1.0",
"eslint-config-airbnb": "^1.0.0",
"eslint-plugin-babel": "^2.1.1",
"eslint-plugin-markdown": "git+https://github.com/ant-design/eslint-plugin-markdown.git",
"eslint-plugin-react": "^3.3.1",
"expect.js": "~0.3.1",
"extract-text-webpack-plugin": "^0.9.1",
Expand All @@ -93,14 +94,14 @@
"json-loader": "^0.5.1",
"less": "~2.5.3",
"less-loader": "^2.2.0",
"lesshint": "git+https://github.com/ant-design/lesshint.git",
"lodash": "^3.10.0",
"nico-jsx": "~0.6.0",
"pre-commit": "1.x",
"react": "~0.14.2",
"react-addons-test-utils": "~0.14.2",
"react-dom": "~0.14.2",
"react-router": "~1.0.0",
"eslint-plugin-markdown": "git+https://github.com/ant-design/eslint-plugin-markdown.git",
"webpack": "^1.10.1",
"webpack-babel-jest": "^1.0.0",
"webpack-dev-middleware": "^1.2.0"
Expand All @@ -111,8 +112,9 @@
"clean": "rm -rf _site dist",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy",
"just-deploy": "npm run clean && webpack --config webpack.deploy.config.js && webpack --config webpack.antd.config.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js",
"lint": "eslint components test index.js --ext '.js,.jsx' && npm run mdlint",
"lint": "eslint components test index.js --ext '.js,.jsx' && npm run mdlint && npm run lesshint",
"mdlint": "eslint components/*/demo/*.md --ext '.md' --global 'React,ReactDOM' --rule 'no-console: 0'",
"lesshint": "lesshint style/ -e 'style/+(core|mixins)/+(base|iconfont|normalize|layouts|compatibility|grid).less'",
"test": "npm run lint && webpack && npm run jest",
"jest": "jest",
"pub": "sh ./scripts/publish.sh",
Expand Down
3 changes: 2 additions & 1 deletion style/components/alert.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
}
}

&-close-icon, &-with-description-close-icon {
&-close-icon,
&-with-description-close-icon {
font-size: 12px;
position: absolute;
right: 8px;
Expand Down
7 changes: 4 additions & 3 deletions style/components/badge.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
z-index: 10;
font-family: tahoma;
box-shadow: 0 0 0 1px #fff;
a, a:hover {
a,
a:hover {
color: #fff;
}
}
Expand Down Expand Up @@ -63,9 +64,9 @@ a .@{badge-prefix-cls} {
}
}

.@{number-prefix-cls}{
.@{number-prefix-cls} {
overflow: hidden;
&-only{
&-only {
display: inline-block;
transition: transform .3s @ease-in-out;
}
Expand Down
6 changes: 4 additions & 2 deletions style/components/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
.btn-ghost;
}

&-circle, &-circle-outline {
&-circle,
&-circle-outline {
.btn-circle(@btn-prefix-cls);
}

Expand Down Expand Up @@ -79,7 +80,8 @@
}

// To ensure that a space will be placed between character and `Icon`.
> .@{iconfont-css-prefix} + span, > span + .@{iconfont-css-prefix} {
> .@{iconfont-css-prefix} + span,
> span + .@{iconfont-css-prefix} {
margin-left: 0.5em;
}
}
8 changes: 5 additions & 3 deletions style/components/calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
height: 246px;
}

table, td, th, td {
border: none;
table,
th,
td {
border: 0;
}

td {
Expand Down Expand Up @@ -150,7 +152,7 @@
}

&-fullscreen {
border-top: none;
border-top: 0;
}

&-fullscreen &-table {
Expand Down
8 changes: 5 additions & 3 deletions style/components/carousel/slick-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
top: 50%;
margin-top: -10px;
padding: 0;
border: none;
border: 0;
outline: none;
&:hover, &:focus {
&:hover,
&:focus {
outline: none;
background: transparent;
color: transparent;
Expand Down Expand Up @@ -79,7 +80,8 @@
color: transparent;
padding: 5px;
cursor: pointer;
&:hover, &:focus {
&:hover,
&:focus {
outline: none;
&:before {
opacity: 1;
Expand Down
20 changes: 9 additions & 11 deletions style/components/collapse.less
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
@collapse-prefix-cls: ant-collapse;

#arrow {
.close() {
.iconfont-size-under-12px(7px, 270deg);
}
.open() {
.iconfont-size-under-12px(7px, 360deg);
}
.collapse-close() {
.iconfont-size-under-12px(7px, 270deg);
}
.collapse-open() {
.iconfont-size-under-12px(7px, 360deg);
}

.@{collapse-prefix-cls} {
Expand All @@ -17,7 +15,7 @@
& > &-item {
border-top: 1px solid #d9d9d9;
&:first-child {
border-top: none;
border-top: 0;
}

> .@{collapse-prefix-cls}-header {
Expand All @@ -29,7 +27,7 @@
position: relative;

.arrow {
#arrow > .close();
.collapse-close();
.iconfont-mixin();
position: absolute;
color: #666;
Expand All @@ -44,7 +42,7 @@
top: ~"16px \9";
left: ~"0 \9";
&:before {
content:"\e611";
content: "\e611";
}
}
}
Expand Down Expand Up @@ -80,7 +78,7 @@

& > &-item > &-header[aria-expanded="true"] {
.arrow {
#arrow > .open();
.collapse-open();
}
}
}
9 changes: 6 additions & 3 deletions style/components/datepicker/Calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@
width: 100%;
}

table, td, th, td {
border: none;
table,
th,
td {
border: 0;
}

&-calendar-table {
Expand Down Expand Up @@ -206,7 +208,8 @@
border-bottom-right-radius: 4px;
}

&-last-month-cell &-date, &-next-month-btn-day &-date {
&-last-month-cell &-date,
&-next-month-btn-day &-date {
color: #bbb;
}

Expand Down
5 changes: 3 additions & 2 deletions style/components/datepicker/DecadePanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
}
}

.@{calendar-prefix-cls}-decade-panel-last-century-cell, .@{calendar-prefix-cls}-decade-panel-next-century-cell {
.@{calendar-prefix-cls}-decade-panel-decade{
.@{calendar-prefix-cls}-decade-panel-last-century-cell,
.@{calendar-prefix-cls}-decade-panel-next-century-cell {
.@{calendar-prefix-cls}-decade-panel-decade {
user-select: none;
-webkit-user-select: none;
}
Expand Down
5 changes: 3 additions & 2 deletions style/components/datepicker/YearPanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
}
}

.@{calendar-prefix-cls}-year-panel-last-decade-cell, .@{calendar-prefix-cls}-year-panel-next-decade-cell {
.@{calendar-prefix-cls}-year-panel-year{
.@{calendar-prefix-cls}-year-panel-last-decade-cell,
.@{calendar-prefix-cls}-year-panel-next-decade-cell {
.@{calendar-prefix-cls}-year-panel-year {
user-select: none;
-webkit-user-select: none;
}
Expand Down
4 changes: 2 additions & 2 deletions style/components/dialog.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@dialog-prefix-cls: ant-modal;

@import "./dialog/Dialog.less";
@import "./dialog/Mask.less";
@import "./dialog/Dialog";
@import "./dialog/Mask";

.@{dialog-prefix-cls} {
&-header {
Expand Down
2 changes: 1 addition & 1 deletion style/components/dialog/Dialog.less
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
&-content {
position: relative;
background-color: #fff;
border: none;
border: 0;
border-radius: @border-radius-base;
background-clip: padding-box;
outline: 0;
Expand Down
27 changes: 16 additions & 11 deletions style/components/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ input[type="checkbox"] {
}
}

.@{css-prefix}form-text, .@{css-prefix}form-split {
.@{css-prefix}form-text,
.@{css-prefix}form-split {
margin: 0!important;
padding-top: 7px;
padding-bottom: 7px;
Expand Down Expand Up @@ -243,7 +244,8 @@ form {
}
}

.@{css-prefix}form-horizontal, .@{css-prefix}form-inline {
.@{css-prefix}form-horizontal,
.@{css-prefix}form-inline {
label {
padding-top: 7px;
padding-bottom: 7px;
Expand All @@ -255,7 +257,10 @@ form {
}

// Validation state
.has-success, .has-warning, .has-error, .is-validating {
.has-success,
.has-warning,
.has-error,
.is-validating {
&.has-feedback:after {
position: absolute;
bottom: 0;
Expand Down Expand Up @@ -382,36 +387,36 @@ form {
.is-validating {
&.has-feedback:after {
display: inline-block;
.animation(loadingCircle 1s infinite linear );
content:"\e6a1";
.animation(loadingCircle 1s infinite linear);
content: "\e6a1";
}
}

// need there different zoom animation
// otherwise won't trigger anim
@keyframes diffZoomIn1 {
0%{
0% {
transform: scale(0);
}
100%{
100% {
transform: scale(1);
}
}

@keyframes diffZoomIn2 {
0%{
0% {
transform: scale(0);
}
100%{
100% {
transform: scale(1);
}
}

@keyframes diffZoomIn3 {
0%{
0% {
transform: scale(0);
}
100%{
100% {
transform: scale(1);
}
}
Loading

0 comments on commit 8d36dc6

Please sign in to comment.