diff --git a/.circleci/config.yml b/.circleci/config.yml index fea9a252df357..d99d06a7712dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,6 +87,9 @@ jobs: - run: name: Eslint command: yarn eslint:ci + - run: + name: Stylelint + command: yarn stylelint - run: name: Lint JSON command: yarn jsonlint diff --git a/.stylelintrc.js b/.stylelintrc.js index 9b3099c91db37..27191eb6468a9 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -1,9 +1,18 @@ +// const baseline = require('@material-ui/monorepo/.stylelintrc'); + +// module.exports = { +// ...baseline, +// } + module.exports = { - "extends": [ - "stylelint-config-recommended", - "stylelint-config-styled-components" - ], - "processors": [ - "stylelint-processor-styled-components" - ] -} \ No newline at end of file + processors: ['stylelint-processor-styled-components'], + extends: 'stylelint-config-standard', + rules: { + 'value-no-vendor-prefix': true, + 'property-no-vendor-prefix': true, + 'no-empty-source': null, + 'no-missing-end-of-source-newline': null, + 'declaration-colon-newline-after': null, + 'value-keyword-case': null, + }, +}; diff --git a/package.json b/package.json index 2e092040f46fd..a1e3f6863a419 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "demo:build": "yarn workspace demo-app build", "demo:export": "yarn workspace demo-app export", "deduplicate": "node scripts/deduplicate.js", + "stylelint": "stylelint '**/*.js' '**/*.ts' '**/*.tsx'", "prettier": "yarn babel-node -i '/node_modules/(?!@material-ui)/' ./scripts/prettier.js --branch master", "test": "lerna run test --parallel", "test:coverage": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc mocha 'packages/**/*.test.tsx' --exclude '**/node_modules/**' && nyc report -r lcovonly", @@ -101,10 +102,8 @@ "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.28.0", "sinon": "^9.0.2", - "stylelint": "^13.3.3", - "stylelint-config-recommended": "^3.0.0", + "stylelint": "^13.7.2", "stylelint-config-standard": "^20.0.0", - "stylelint-config-styled-components": "^0.1.1", "stylelint-processor-styled-components": "^1.10.0", "ts-jest": "^25.2.0", "typescript": "^3.9.6", diff --git a/packages/demo-app/package.json b/packages/demo-app/package.json index eb48071c4a612..9ad96d64142e0 100644 --- a/packages/demo-app/package.json +++ b/packages/demo-app/package.json @@ -44,8 +44,7 @@ "build": "./node_modules/.bin/webpack -p --config ./webpack.prod.js", "start": "./node_modules/.bin/webpack-dev-server --config webpack.dev.js", "export": "mv dist ../../docs/export/demo", - "lint": "../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../.stylelintrc.js" + "lint": "../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../.eslintrc.js" }, "setupFiles": [ "/src/setupTests.js" diff --git a/packages/demo-app/src/app/app-bar.tsx b/packages/demo-app/src/app/app-bar.tsx index 565b7a43ea5ee..5c7738ed62172 100644 --- a/packages/demo-app/src/app/app-bar.tsx +++ b/packages/demo-app/src/app/app-bar.tsx @@ -30,6 +30,7 @@ const DemoAppBarStyled = styled(AppBar)` white-space: nowrap; letter-spacing: 0.3rem; } + .product-title { margin-left: 10px; color: ${(p) => p.theme.colors.xColor}; diff --git a/packages/demo-app/src/app/app-intro.tsx b/packages/demo-app/src/app/app-intro.tsx index a161347ff6f4d..af40483dad859 100644 --- a/packages/demo-app/src/app/app-intro.tsx +++ b/packages/demo-app/src/app/app-intro.tsx @@ -23,12 +23,14 @@ const Splash = styled.div` padding-bottom: 0 !important; align-items: center !important; } + .logo { width: 120px; height: 120px; flex-shrink: 0; margin-bottom: 16px; } + @media (min-width: 960px) { .splash-container { text-align: left; @@ -38,18 +40,21 @@ const Splash = styled.div` padding-bottom: 128px; max-width: 960px; } + .logo { width: 195px; height: 175px; margin-right: 64px; } } + @media (min-width: 600px) { .splash-container { padding-left: 24px; padding-right: 24px; } } + .title { flex-grow: 1; font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; @@ -68,7 +73,7 @@ const Splash = styled.div` font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif; font-weight: 400; line-height: 1.334; - letter-spacing: 0em; + letter-spacing: 0; } .product-title { @@ -77,6 +82,7 @@ const Splash = styled.div` font-weight: 500; text-shadow: -2px 1px 4px #929292; } + .product-title-logo { color: ${(p) => p.theme.colors.secondApp}; position: absolute; @@ -89,9 +95,11 @@ const Splash = styled.div` display: none; text-shadow: -2px 1px 4px ${(p) => p.theme.colors.xShadowColor}; } + .logo-container { position: relative; } + .main-action-button { margin-top: 32px; border: 1px solid rgba(25, 118, 210, 0.5); diff --git a/packages/demo-app/src/app/demos/grid/components/main-container.tsx b/packages/demo-app/src/app/demos/grid/components/main-container.tsx index c13d27d2bcda0..11b980a090b15 100644 --- a/packages/demo-app/src/app/demos/grid/components/main-container.tsx +++ b/packages/demo-app/src/app/demos/grid/components/main-container.tsx @@ -9,13 +9,16 @@ export const MainContainer = styled.div` background-color: ${(p) => p.theme.colors.app} !important; color: ${(p) => p.theme.colors.secondApp} !important; } + .ag-theme-balham .ag-header { background-color: ${(p) => p.theme.colors.grid.headerBackground} !important; color: ${(p) => p.theme.colors.grid.headerTitle} !important; } + .ag-theme-balham .ag-root { border: none !important; } + .grid-root { &.material-grid { .columns-container { @@ -27,23 +30,29 @@ export const MainContainer = styled.div` border-right-color: ${(p) => p.theme.colors.grid.headerBorderRight}; } } + .window { .material-row { color: ${(p) => p.theme.colors.grid.rowColor}; + &.odd { background-color: ${(p) => p.theme.colors.grid.oddRowBackground}; } + &.even { background-color: ${(p) => p.theme.colors.grid.evenRowBackground}; } + .material-cell { border-right: none; border-bottom-color: #bdc3c773; } + &:hover { background-color: ${(p) => p.theme.colors.grid.rowHoverBackground}; color: ${(p) => p.theme.colors.grid.rowHoverColor}; } + &.selected { background-color: ${(p) => p.theme.colors.grid.rowSelectedBackground}; color: ${(p) => p.theme.colors.grid.rowSelectedColor}; @@ -52,6 +61,7 @@ export const MainContainer = styled.div` } } } + .splitter-panel { background-color: #cecece4f !important; color: rgb(53, 54, 58); @@ -60,10 +70,12 @@ export const MainContainer = styled.div` .ag-header { border-top: 1px solid ${(p) => p.theme.colors.app} !important; } + .grid-title .grid-logo.mui { margin: 5px; } } + .splitter-handler-wrapper { border-right: 2px solid #2c2e2f !important; } diff --git a/packages/demo-app/src/app/demos/grid/components/styled-panel.tsx b/packages/demo-app/src/app/demos/grid/components/styled-panel.tsx index 57292f7c73410..ea068bf06f431 100644 --- a/packages/demo-app/src/app/demos/grid/components/styled-panel.tsx +++ b/packages/demo-app/src/app/demos/grid/components/styled-panel.tsx @@ -7,6 +7,7 @@ export const StyledPanels = styled.div` padding: 20px; background-color: ${(props) => props.theme.colors.panelBackground}; color: ${(props) => props.theme.colors.text}; + .panel-title { background-color: ${(props) => props.theme.colors.panelTitleBg}; color: ${(props) => props.theme.colors.panelTitle}; @@ -22,6 +23,7 @@ export const StyledPanels = styled.div` font-size: 12px; } } + .input-text { margin: 5px; width: 100px; @@ -33,6 +35,7 @@ export const StyledPanels = styled.div` input { color: ${(p) => p.theme.colors.text}; } + .MuiFormLabel-root { color: ${(p) => p.theme.colors.label}; @@ -41,19 +44,22 @@ export const StyledPanels = styled.div` } } } + .apply-btn { margin-left: 15px; margin-top: 5px; } + .switch { display: none; color: ${(p) => p.theme.colors.text}; font-size: 12px; - & label: { + & label { font-size: 12px; } } + .action-button-bar { padding: 10px; align-items: center; diff --git a/packages/grid/data-grid/package.json b/packages/grid/data-grid/package.json index 0780d6baebc89..61842eadd9b71 100644 --- a/packages/grid/data-grid/package.json +++ b/packages/grid/data-grid/package.json @@ -26,8 +26,7 @@ ], "scripts": { "precommit": "npm run lint", - "lint": "eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../../.stylelintrc.js", + "lint": "eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js", "typescript": "tsc -p tsconfig.json", "build": "cd ../ && rollup --config rollup.data-grid.config.js" }, diff --git a/packages/grid/x-grid/package.json b/packages/grid/x-grid/package.json index 6eb365ff624f5..3582a23facb5c 100644 --- a/packages/grid/x-grid/package.json +++ b/packages/grid/x-grid/package.json @@ -26,8 +26,7 @@ ], "scripts": { "precommit": "npm run lint", - "lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../../.stylelintrc.js", + "lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js", "typescript": "tsc -p tsconfig.json", "build": "cd ../ && rollup --config rollup.x-grid.config.js" }, diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 9145dc83190da..657053df257b4 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -49,8 +49,7 @@ "start": "start-storybook -p 6006 --ci", "build": "build-storybook -o dist/ -s storybook --quiet", "export": "mv dist ../../docs/export/storybook", - "lint": "../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ./.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../.stylelintrc.js", + "lint": "../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ./.eslintrc.js", "test": "jest -c integration/setup/jest.config.js --detectOpenHandles --force-exit --runInBand", "test:ci": "start-server-and-test start http://localhost:6006 test" } diff --git a/packages/x-grid-data-generator/package.json b/packages/x-grid-data-generator/package.json index a72db1a711104..5758f310effd0 100644 --- a/packages/x-grid-data-generator/package.json +++ b/packages/x-grid-data-generator/package.json @@ -20,8 +20,7 @@ "precommit": "npm run lint", "build": "rollup -c", "start": "rollup -cw", - "lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../../.stylelintrc.js" + "lint": "../../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../../.eslintrc.js" }, "dependencies": { "@types/chance": "^1.1.0", diff --git a/packages/x-license/package.json b/packages/x-license/package.json index e7b7ee4050eff..a7fa55c766936 100644 --- a/packages/x-license/package.json +++ b/packages/x-license/package.json @@ -30,8 +30,7 @@ "precommit": "npm run lint", "build": "rollup -c", "start": "rollup -cw", - "lint": "../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../.eslintrc.js && npm run lint:css", - "lint:css": "stylelint 'src/**/*.{ts,tsx}' ../../.stylelintrc.js", + "lint": "../../node_modules/.bin/tsc --noEmit && eslint 'src/**/*.{ts,tsx}' --quiet --fix -c ../../.eslintrc.js", "test": "../../node_modules/.bin/jest --config jest.config.js" }, "setupFiles": [ diff --git a/yarn.lock b/yarn.lock index 7304470e6b671..3b3daac37a289 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20349,11 +20349,6 @@ stylelint-config-standard@^20.0.0: dependencies: stylelint-config-recommended "^3.0.0" -stylelint-config-styled-components@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/stylelint-config-styled-components/-/stylelint-config-styled-components-0.1.1.tgz#b408388d7c687833ab4be4c4e6522d97d2827ede" - integrity sha512-z5Xz/9GmvxO6e/DLzBMwkB85zHxEEjN6K7Cj80Bi+o/9vR9eS3GX3E9VuMnX9WLFYulqbqLtTapGGY28JBiy9Q== - stylelint-processor-styled-components@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/stylelint-processor-styled-components/-/stylelint-processor-styled-components-1.10.0.tgz#8082fc68779476aac411d3afffac0bc833d77a29" @@ -20364,10 +20359,10 @@ stylelint-processor-styled-components@^1.10.0: micromatch "^4.0.2" postcss "^7.0.26" -stylelint@^13.3.3: - version "13.7.1" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.7.1.tgz#bee97ee78d778a3f1dbe3f7397b76414973e263e" - integrity sha512-qzqazcyRxrSRdmFuO0/SZOJ+LyCxYy0pwcvaOBBnl8/2VfHSMrtNIE+AnyJoyq6uKb+mt+hlgmVrvVi6G6XHfQ== +stylelint@^13.7.2: + version "13.7.2" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.7.2.tgz#6f3c58eea4077680ed0ceb0d064b22b100970486" + integrity sha512-mmieorkfmO+ZA6CNDu1ic9qpt4tFvH2QUB7vqXgrMVHe5ENU69q7YDq0YUg/UHLuCsZOWhUAvcMcLzLDIERzSg== dependencies: "@stylelint/postcss-css-in-js" "^0.37.2" "@stylelint/postcss-markdown" "^0.36.1"