Skip to content

WIP: Optional preflight styles #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/components/api/x-toggles/template.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ul class="docs-mb-6">
<ul class="docs-mb-6 docs-list-none">
{{#each-in toggles as |key toggle|}}
{{#if (not-eq toggle undefined)}}
<li class="docs-inline docs-ml-4">
2 changes: 1 addition & 1 deletion addon/components/docs-header/search-results/template.hbs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
targetAttachment="bottom left"
constraints=(array (hash to="window" attachment="together" pin=true))}}

<ul class="docs-w-76 docs-bg-white docs-shadow-md" data-test-search-result-list>
<ul class="docs-list-none docs-w-76 docs-bg-white docs-shadow-md" data-test-search-result-list>
{{#each (take 5 searchResults) as |result index|}}
<li>
{{docs-header/search-result
2 changes: 1 addition & 1 deletion addon/components/docs-header/version-selector/template.hbs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
clickOutsideToClose=true
onClose=(action on-close)
targetAttachment="bottom right"}}
<ul class="docs-mt-2 docs-bg-white docs-shadow-md docs-text-xs docs-rounded docs-z-10">
<ul class="docs-list-none docs-mt-2 docs-bg-white docs-shadow-md docs-text-xs docs-rounded docs-z-10">
{{#each sortedVersions as |version|}}
<li data-test-id="version">
<a {{action "changeVersion" version}} href="#"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav class="AddonDocs-DocsViewer-CurrentPageIndex docs-hidden xl:docs-block docs-flex-no-shrink docs-mr-auto" data-test-current-page-index>
<div class="docs-sticky docs-top-0 docs-pt-4 docs-pb-8 docs-pr-8 docs-max-h-screen docs-overflow-y-scroll">
<ul class="docs-border-l docs-border-grey-lighter docs-pl-6 docs-leading-normal">
<ul class="docs-list-none docs-border-l docs-border-grey-lighter docs-pl-6 docs-leading-normal">
{{#if pageIndex.length}}
<li class="docs-mt-12 docs-text-grey docs-font-bold docs-tracking-wide docs-uppercase docs-text-xxs">
On This Page
2 changes: 2 additions & 0 deletions addon/components/docs-viewer/x-nav-list/component.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@ import { hbs } from 'ember-cli-htmlbars';
export default Component.extend({
tagName: 'ul',

classNames: ['docs-list-none'],

layout: hbs`
{{yield (hash
item=(component 'docs-viewer/x-nav-item')
8 changes: 5 additions & 3 deletions addon/styles/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -834,7 +834,9 @@ module.exports = {
plugins: [],

corePlugins: {
container: false
},

container: false,
// @ifdef NO_BASE_STYLES
preflight: false
// @endif
}
};
20 changes: 18 additions & 2 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const Project = require('ember-cli/lib/models/project');
const MergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
const preprocess = require('broccoli-preprocess-tree');

module.exports = function(defaults) {
let project = Project.closestSync(process.cwd());
@@ -43,9 +44,24 @@ module.exports = function(defaults) {
filter: {
enabled: false,
plugins: []
},
}
}
});

let appTree = new Funnel(app.toTree(), {
exclude: ['addon/styles']
});

let styles = preprocess('addon/styles', {
context: {
NO_BASE_STYLES: true
},
destDir: 'addon/styles'
});

return app.toTree();
styles = new Funnel(styles, { destDir: 'addon/styles' });

appTree = new MergeTrees([appTree, styles]);

return appTree;
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -95,6 +95,7 @@
"@ember/optional-features": "^1.0.0",
"babel-eslint": "^10.0.3",
"broccoli-asset-rev": "^3.0.0",
"broccoli-preprocess-tree": "^0.4.0",
"chai": "^4.2.0",
"common-tags": "^1.8.0",
"ember-classy-page-object": "^0.5.0",
22 changes: 22 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -3224,6 +3224,18 @@ broccoli-postcss@^5.0.0:
object-assign "^4.1.1"
postcss "^7.0.5"

broccoli-preprocess-tree@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/broccoli-preprocess-tree/-/broccoli-preprocess-tree-0.4.0.tgz#54440e29d829f721443ccfb6169520f6b73cf507"
integrity sha1-VEQOKdgp9yFEPM+2FpUg9rc89Qc=
dependencies:
broccoli-writer "^0.1.1"
copy-dereference "^1.0.0"
fs-extra "^0.30.0"
glob "^5.0.10"
lodash-node "^3.9.3"
preprocess "^2.1.1"

broccoli-replace@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/broccoli-replace/-/broccoli-replace-0.12.0.tgz#36460a984c45c61731638c53068b0ab12ea8fdb7"
@@ -8582,6 +8594,11 @@ lodash-es@^4.17.11:
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78"
integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==

lodash-node@^3.9.3:
version "3.10.2"
resolved "https://registry.yarnpkg.com/lodash-node/-/lodash-node-3.10.2.tgz#2598d5b1b54e6a68b4cb544e5c730953cbf632f7"
integrity sha1-JZjVsbVOami0y1ROXHMJU8v2Mvc=

lodash._baseassign@^3.0.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
@@ -10354,6 +10371,11 @@ prepend-http@^2.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=

preprocess@^2.1.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/preprocess/-/preprocess-2.3.1.tgz#bda3022e623e9b599d4c0828186d85bd9f12c500"
integrity sha1-vaMCLmI+m1mdTAgoGG2FvZ8SxQA=

[email protected]:
version "3.1.0"
resolved "https://registry.yarnpkg.com/pretender/-/pretender-3.1.0.tgz#d8d7cc8502a9dbda82346ea399b9c63e7012f584"