-
Notifications
You must be signed in to change notification settings - Fork 0
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
Documentation notes and questions #7
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,29 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Component Test Page</title> | ||
<script src="/src/index.ts" type="module"></script> | ||
<!-- | ||
the following file is public/global.css, it will not have postcss processing | ||
run on it and will be copied as is into the dist directory upon a build. | ||
--> | ||
<link rel="stylesheet" href="/global.css" /> | ||
<!-- | ||
the following files have to be referenced individually for development but roll up into a single style.css | ||
file in the built package, see comments in src/index.ts for more info and to control the files bundled. | ||
These files are processed by postcss. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may not be true that these need to be referenced here as long as they are imported in |
||
-- need to validate this statement as chrome and safari seem like they may handle them the same. The files | ||
-- through vite definitely look like javascript | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is what
|
||
These also need to be referenced as javascript files instead of as css files because of vite's wrapping of them. | ||
--> | ||
<script src="/src/global.css" type="module" /></script> | ||
<script src="/src/another.css" type="module" /></script> | ||
</head> | ||
|
||
<body> | ||
<p><outline-core-link><a href="https://github.com/phase2/outline">outline-core-link</a></outline-core-link></p> | ||
<p><outline-link><a href="https://github.com/phase2/outline">outline-link</a></outline-link></p> | ||
<p><outline-link><a href="https://github.com/phase2/outline">outline-link must be implemented by the project</a></outline-link></p> | ||
<p><a href="https://github.com/phase2/outline">Normal a tag link</a></p> | ||
<p><a href="https://no.such.domain.to.demo.difference.in.visited.psuedo.class/" class="special-link">Link with class declaration</a></p> | ||
</body> | ||
|
||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* Second CSS file to demo the need to individually reference them and show they combine on build */ | ||
a { | ||
&.special-link { | ||
font-size: 24pt; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* CSS file to demo how one might approach global css that postcss processing is desired on */ | ||
a { | ||
color: purple; | ||
&:visited { | ||
color: var(--brand-secondary); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,20 +12,25 @@ | |
// import { Component2 } from './components/component2'; | ||
// import { OutlineAlert } from './components/shared/outline-alert/outline-alert'; | ||
import { OutlineExample } from './components/shared/outline-example/outline-example'; | ||
// import { OutlineCoreLink } from '@phase2/outline-core-link'; | ||
import { OutlineCoreLink } from '@phase2/outline-core-link'; | ||
// Add more component imports as needed... | ||
|
||
// Importing specific controllers from the `src/controllers` directory | ||
// import { AdoptedStylesheets } from '@phase2/outline-adopted-stylesheets-controller'; | ||
// import { Controller1 } from './controllers/controller1'; | ||
// import { Controller2 } from './controllers/controller2'; | ||
// Add more controller imports as needed... | ||
// CSS Imports - reference css files here so that they aggregate in style.css in the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the comment the comment above the references for these files in |
||
// produced package | ||
import '../outline.theme.css'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added to show use of |
||
import './global.css'; | ||
import './another.css'; | ||
|
||
// Exporting all imported components and controllers for external use | ||
export { | ||
// OutlineAlert, | ||
OutlineExample, | ||
// OutlineCoreLink, | ||
OutlineCoreLink, | ||
// Component1, | ||
// Component2, | ||
// Add more component exports as needed... | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,17 @@ import ts from 'vite-plugin-ts'; | |
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
base: './', | ||
plugins: [ts()], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need this to avoid errors like the following on
|
||
optimizeDeps: { | ||
esbuildOptions: { | ||
tsconfigRaw: { | ||
compilerOptions: { | ||
experimentalDecorators: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need this to avoid errors like the following on
|
||
}, | ||
}, | ||
}, | ||
}, | ||
css: { | ||
postcss: { | ||
plugins: [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Determined this experimentally. Even if referenced in
src/index.ts
it did not appear to be getting processed during ayarn watch:vite
. If referenced bysrc/index.ts
yarn build
results in the contents ofpublic/global.css
being processed by postcss and put indist/style.css
butdist/global.css
was not processed and just copied as is.