-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
[docs] New code blocks #764
Conversation
Netlify deploy preview |
import 'docs/src/styles.css'; | ||
import 'docs/src/styles/style.css'; |
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.
This is temporary just to support the current setup in place, 'docs/src/styles/style.css'
will go away eventually
@michaldudak do you have a clue why I was having minor problems with path resolution that were fixed by adding |
tsconfig fields aren't merged with parent config settings but replaced, so by adding |
The demos on old pages are getting messed up a bit. Would it be problematic to actually edit the styles on the existing pages instead of the |
docs/src/styles.css
Outdated
|
||
:root { | ||
--color-content: #fff; | ||
--font-mono: 'Menlo', 'Consolas', monospace; |
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.
Is the default font OK for Linux users?
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.
Good point, I'll add a couple more fallbacks
docs/src/components/demo/loadDemo.ts
Outdated
@@ -127,9 +126,9 @@ async function loadSimpleDemo(path: string, variantName: string): Promise<DemoVa | |||
const jsFilePath = mainFilePath.replace(/\.tsx?$/, '.js'); | |||
if (mainFileLanguage === 'ts' && existsSync(jsFilePath)) { | |||
const jsContent = await readFile(jsFilePath, 'utf-8'); | |||
const jsPrettyPromise = await codeToHtml(jsContent, { | |||
const jsPrettyPromise = highlighter.codeToHtml(jsContent, { |
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.
const jsPrettyPromise = highlighter.codeToHtml(jsContent, { | |
const jsPrettyContent = highlighter.codeToHtml(jsContent, { |
863d729
to
84f3a60
Compare
Oh man this annoys me the hell out of me, but I don't know if it's worth our time to refactor styles on the old pages. The root issue is that Anything particular that's messed up and bothers you? |
@michaldudak looks like unrelated tests are failing after rebasing, I assume I can ignore them? |
It's nothing blocking. The main issue is that demos render in dark mode (following my Aside from this, I just realized it could be nice to detect cmd/ctrl + a when a demo source is focused and select just the demo source instead of the whole page (could be done in a separate PR, of course) |
As for the broken tests - this looks like an issue after migrating to vitest. I'll see what's going on right away. EDIT: likely fixed in #765 |
5dd6441
to
db534bc
Compare
Agree, added that
Thanks! |
One thing I'm missing is the Reset button. It used to come in handy to reload the demo to its initial state. |
We decided to remove it, among other things, since there was too much going on in the toolbar. I agree it has its uses, but it's probably more so for us as we maintain and test the components in the docs way more often than the end user would. |
See https://deploy-preview-764--base-ui.netlify.app/new/components/dialog