Skip to content

Commit a61d13b

Browse files
authored
Merge pull request #229 from ember-learn/fix-styles
Revert ember-cli-tailwind upgrade
2 parents 5b867af + 4c6972d commit a61d13b

File tree

10 files changed

+545
-174
lines changed

10 files changed

+545
-174
lines changed

addon/tailwind/config/tailwind.js

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1+
'use strict';
2+
13
import colors from './colors';
24
import screens from './screens';
35
import fonts from './fonts';
46
import textSizes from './text-sizes';
57
import fontWeights from './font-weights';
68
import leading from './line-height';
79
import tracking from './letter-spacing';
8-
import textColors from './text-colors';
9-
import backgroundColors from './background-colors';
10-
import backgroundSize from './background-size';
1110
import borderWidths from './border-widths';
12-
import borderColors from './border-colors';
1311
import borderRadius from './border-radius';
1412
import width from './width';
1513
import height from './height';
@@ -27,18 +25,18 @@ import svgFill from './svg-fill';
2725
import svgStroke from './svg-stroke';
2826

2927
export default {
28+
3029
colors,
3130
screens,
3231
fonts,
3332
textSizes,
3433
fontWeights,
3534
leading,
3635
tracking,
37-
textColors,
38-
backgroundColors,
39-
backgroundSize,
36+
textColors: colors,
37+
backgroundColors: colors,
4038
borderWidths,
41-
borderColors,
39+
borderColors: Object.assign({ default: colors['grey-light'] }, colors),
4240
borderRadius,
4341
width,
4442
height,
@@ -103,26 +101,6 @@ export default {
103101
zIndex: ['responsive'],
104102
},
105103

106-
/*
107-
|-----------------------------------------------------------------------------
108-
| Plugins https://tailwindcss.com/docs/plugins
109-
|-----------------------------------------------------------------------------
110-
|
111-
| Here is where you can register any plugins you'd like to use in your
112-
| project. Tailwind's built-in `container` plugin is enabled by default to
113-
| give you a Bootstrap-style responsive container component out of the box.
114-
|
115-
| Be sure to view the complete plugin documentation to learn more about how
116-
| the plugin system works.
117-
|
118-
*/
119-
120-
plugins: [
121-
],
122-
123-
/*
124-
|-----------------------------------------------------------------------------
125-
126104
/*
127105
|-----------------------------------------------------------------------------
128106
| Advanced Options https://tailwindcss.com/docs/configuration#options

addon/tailwind/modules.css

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,62 @@
11
/**
2-
* This injects Tailwind's base styles, which is a combination of
3-
* Normalize.css and some additional base styles.
4-
*
5-
* You can see the styles here:
6-
* https://github.com/tailwindcss/tailwindcss/blob/master/css/preflight.css
7-
*/
8-
@import "tailwindcss/preflight";
2+
* This injects Tailwind's base styles, which is a combination of
3+
* Normalize.css and some additional base styles.
4+
*
5+
* You can see the styles here:
6+
* https://github.com/tailwindcss/tailwindcss/blob/master/css/preflight.css
7+
*
8+
* If using `postcss-import`, you should import this line from it's own file:
9+
*
10+
* @import "./tailwind-preflight.css";
11+
*
12+
* See: https://github.com/tailwindcss/tailwindcss/issues/53#issuecomment-341413622
13+
*/
14+
@import "./tailwind-preflight.css";
915

1016
/**
11-
* This injects any component classes registered by plugins.
12-
*/
13-
@import "tailwindcss/components";
17+
* Here you would add any of your custom component classes; stuff that you'd
18+
* want loaded *before* the utilities so that the utilities could still
19+
* override them.
20+
*
21+
* Example:
22+
*
23+
* .btn { ... }
24+
* .form-input { ... }
25+
*
26+
* Or if using a preprocessor or `postcss-import`:
27+
*
28+
* @import "components/buttons";
29+
* @import "components/forms";
30+
**/
1431

15-
/**
16-
* Here you would add any of your custom component classes; stuff that you'd
17-
* want loaded *before* the utilities so that the utilities could still
18-
* override them.
19-
*/
2032
@import "./components/*.css";
2133

34+
2235
/**
23-
* This injects all of Tailwind's utility classes, generated based on your
24-
* config file.
25-
*/
26-
@import "tailwindcss/utilities";
36+
* This injects all of Tailwind's utility classes, generated based on your
37+
* config file.
38+
*
39+
* If using `postcss-import`, you should import this line from it's own file:
40+
*
41+
* @import "./tailwind-utilities.css";
42+
*
43+
* See: https://github.com/tailwindcss/tailwindcss/issues/53#issuecomment-341413622
44+
*/
45+
46+
@import "./tailwind-utilities.css";
2747

2848
/**
29-
* Here you would add any custom utilities you need that don't come out of the
30-
* box with Tailwind.
31-
*/
49+
* Here you would add any custom utilities you need that don't come out of the
50+
* box with Tailwind.
51+
*
52+
* Example :
53+
*
54+
* .bg-pattern-graph-paper { ... }
55+
* .skew-45 { ... }
56+
*
57+
* Or if using a preprocessor or `postcss-import`:
58+
*
59+
* @import "utilities/background-patterns";
60+
* @import "utilities/skew-transforms";
61+
**/
3262
@import "./utilities/*.css";

addon/tailwind/tailwind-preflight.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@tailwind preflight;

addon/tailwind/tailwind-utilities.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@tailwind utilities;

addon/tailwind/utilities/your-utility.css

Lines changed: 0 additions & 12 deletions
This file was deleted.

index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ module.exports = {
3333
'node_modules/ember-cli-addon-docs/public',
3434
'tests/dummy/public'
3535
]
36+
},
37+
'ember-cli-tailwind': {
38+
buildTarget: 'addon'
3639
}
3740
},
3841

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"ember-cli-htmlbars-inline-precompile": "^1.0.2",
4242
"ember-cli-sass": "7.1.3",
4343
"ember-cli-string-helpers": "^1.7.0",
44-
"ember-cli-tailwind": "^0.6.0",
44+
"ember-cli-tailwind": "^0.4.1",
4545
"ember-code-snippet": "^2.2.0",
4646
"ember-component-css": "^0.3.5",
4747
"ember-concurrency": "^0.8.16",

test-apps/new-addon/tests/acceptance/smoke-test-test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { module, test } from 'qunit';
2-
import { visit, currentURL } from '@ember/test-helpers';
2+
import { visit, find, currentURL } from '@ember/test-helpers';
33
import { setupApplicationTest } from 'ember-qunit';
44

55
module('Acceptance | boot test', function(hooks) {
@@ -10,4 +10,13 @@ module('Acceptance | boot test', function(hooks) {
1010

1111
assert.equal(currentURL(), '/');
1212
});
13+
14+
test('styles are properly loaded', async function(assert) {
15+
await visit('/');
16+
17+
let title = find('h1');
18+
let fontSize = window.getComputedStyle(title).getPropertyValue("font-size");
19+
20+
assert.equal(fontSize, '60px');
21+
});
1322
});
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
<h2 id="title">Welcome to Ember</h2>
1+
{{docs-hero
2+
logo='ember'
3+
slimHeading='New'
4+
strongHeading='Addon'
5+
byline='A simple addon.'}}
26

3-
{{outlet}}
7+
{{outlet}}

0 commit comments

Comments
 (0)