Skip to content

Commit e770ce8

Browse files
josemarluedkesamselikoff
authored andcommitted
Replace ember-cli-tailwind with postcss and tailwindcss (#412)
* Remove ember-cli-tailwind * Use @apply instead of @extend for tailwind classes * Replace ember-cli-tailwind with postcss and tailwindcss
1 parent 2aca70b commit e770ce8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1278
-1148
lines changed

.eslintrc.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
module.exports = {
22
globals: {
3-
server: true,
3+
server: true
44
},
55
root: true,
66
parserOptions: {
77
ecmaVersion: 2018,
88
sourceType: 'module'
99
},
10-
plugins: [
11-
'ember'
12-
],
13-
extends: [
14-
'eslint:recommended',
15-
'plugin:ember/recommended'
16-
],
10+
plugins: ['ember'],
11+
extends: ['eslint:recommended', 'plugin:ember/recommended'],
1712
env: {
1813
browser: true
1914
},
2015
rules: {
21-
'no-unused-vars': ["error", { "args": "none" }],
22-
'no-console': ["error", { allow: ["warn", "error"] }],
16+
'no-unused-vars': ['error', { args: 'none' }],
17+
'no-console': ['error', { allow: ['warn', 'error'] }],
2318

2419
// ember-keyboard uses events
25-
'ember/no-on-calls-in-components': 'off',
20+
'ember/no-on-calls-in-components': 'off'
2621
},
2722
overrides: [
2823
// node files
@@ -31,6 +26,7 @@ module.exports = {
3126
'.eslintrc.js',
3227
'.template-lintrc.js',
3328
'ember-cli-build.js',
29+
'addon/styles/tailwind.js',
3430
'index.js',
3531
'testem.js',
3632
'blueprints/*/index.js',
@@ -53,9 +49,13 @@ module.exports = {
5349
node: true
5450
},
5551
plugins: ['node'],
56-
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
57-
// add your custom rules and overrides for node files here
58-
})
52+
rules: Object.assign(
53+
{},
54+
require('eslint-plugin-node').configs.recommended.rules,
55+
{
56+
// add your custom rules and overrides for node files here
57+
}
58+
)
5959
},
6060

6161
// test files
@@ -73,12 +73,12 @@ module.exports = {
7373
describe: true,
7474
it: true,
7575
beforeEach: true,
76-
afterEach: true,
76+
afterEach: true
7777
},
7878
files: ['tests-node/**/*.js'],
7979
rules: {
8080
'node/no-unpublished-require': 'off'
81-
},
81+
}
8282
}
8383
]
8484
};
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
input[data-search-box-input]::placeholder {
2-
@extend .docs-text-black;
3-
@extend .docs-font-bold;
4-
@extend .docs-opacity-100;
2+
@apply .docs-text-black;
3+
@apply .docs-font-bold;
4+
@apply .docs-opacity-100;
55

66
&:focus {
7-
@extend .docs-text-grey;
7+
@apply .docs-text-grey;
88
}
99
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.ember-modal-dialog {
2-
@extend .docs-z-50;
2+
@apply .docs-z-50;
33
}

addon/styles/addon.scss

+33-20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
// Global settings
22
$site-container: 1400px;
33

4-
@import 'tailwind';
4+
@tailwind preflight;
5+
@tailwind components;
6+
@tailwind utilities;
7+
8+
@import './components/docs-brand-colors';
9+
@import './components/docs-btn';
10+
@import './components/docs-container';
11+
@import './components/docs-md';
12+
13+
@import './utilities/masks';
14+
@import './utilities/nudge';
15+
@import './utilities/overflow-momentum';
16+
517
@import 'pod-styles.scss';
618
@import 'syntax';
719

820
// Figure out how to do this in tailwind
921
.docs-fill-current {
10-
&, & * {
22+
&,
23+
& * {
1124
fill: currentColor;
1225
}
1326
}
@@ -17,31 +30,31 @@ $site-container: 1400px;
1730
}
1831

1932
html {
20-
@extend .docs-min-h-screen;
21-
@extend .docs-flex;
22-
@extend .docs-flex-col;
33+
@apply .docs-min-h-screen;
34+
@apply .docs-flex;
35+
@apply .docs-flex-col;
2336
}
2437

2538
body {
26-
@extend .docs-antialiased;
27-
@extend .docs-font-sans;
28-
@extend .docs-text-base;
29-
@extend .docs-leading-normal;
30-
@extend .docs-text-grey-darkest;
31-
@extend .docs-bg-brand;
32-
33-
@extend .docs-flex-1;
34-
@extend .docs-flex;
35-
@extend .docs-flex-col;
39+
@apply .docs-antialiased;
40+
@apply .docs-font-sans;
41+
@apply .docs-text-base;
42+
@apply .docs-leading-normal;
43+
@apply .docs-text-grey-darkest;
44+
@apply .docs-bg-brand;
45+
46+
@apply .docs-flex-1;
47+
@apply .docs-flex;
48+
@apply .docs-flex-col;
3649
}
3750

3851
body > .ember-view {
39-
@extend .docs-flex-1;
40-
@extend .docs-flex;
41-
@extend .docs-flex-col;
52+
@apply .docs-flex-1;
53+
@apply .docs-flex;
54+
@apply .docs-flex-col;
4255

43-
@extend .docs-mt-1;
44-
@extend .docs-bg-white;
56+
@apply .docs-mt-1;
57+
@apply .docs-bg-white;
4558
}
4659

4760
pre {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
We use CSS Custom Properties so addons can customize their brand theme, but we need to provide a fallback for browsers that don't support them yet (IE). This is the way we do it.
3+
4+
If we get access to the PostCSS pipeline in the future we could use a plugin like this: https://github.com/postcss/postcss-custom-properties
5+
*/
6+
.docs-bg-brand {
7+
@apply docs-bg-brand-var;
8+
}
9+
.hover\:docs-bg-brand:hover {
10+
@apply docs-bg-brand-var ;
11+
}
12+
.focus\:docs-bg-brand:focus {
13+
@apply docs-bg-brand-var;
14+
}
15+
16+
.docs-text-brand {
17+
@apply docs-text-brand-var;
18+
}
19+
.hover\:docs-text-brand:hover {
20+
@apply docs-text-brand-var;
21+
}
22+
.focus\:docs-text-brand:focus {
23+
@apply docs-text-brand-var;
24+
}
25+
26+
.docs-border-brand {
27+
@apply docs-border-brand-var;
28+
}
29+
.hover\:docs-border-brand:hover {
30+
@apply docs-border-brand-var;
31+
}
32+
.focus\:docs-border-brand:focus {
33+
@apply docs-border-brand-var;
34+
}

0 commit comments

Comments
 (0)