Skip to content
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

chore: improve playground #19

Merged
merged 3 commits into from
Jan 29, 2024
Merged

chore: improve playground #19

merged 3 commits into from
Jan 29, 2024

Conversation

uncenter
Copy link
Contributor

@uncenter uncenter commented Jan 28, 2024

This PR adds code to update the <title> element with the current selected theme name, and improves styling.

@uncenter uncenter changed the title chore(playground): update <title> with theme name, improved styling chore: improve playground Jan 28, 2024
import { themes } from '../../packages/tm-themes/index'
import { grammars } from '../../packages/tm-grammars/index'

useDark()

const theme = useStorage('tm-theme', 'vitest-dark')
const theme = useStorage('tm-theme', themes.find(t => t.name === 'vitest-dark') as ThemeInfo)
Copy link
Member

@antfu antfu Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const theme = useStorage('tm-theme', themes.find(t => t.name === 'vitest-dark') as ThemeInfo)
const theme = useStorage('tm-theme', 'vitesse-dark')

I made a typo here - by why do we need to store the theme object?

Copy link
Contributor Author

@uncenter uncenter Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To store the displayName for the page's <title>. I wasn't sure how else to do it since I'm unfamiliar with Vue.

@antfu antfu merged commit e444180 into shikijs:main Jan 29, 2024
2 checks passed
evoactivity added a commit to evoactivity/textmate-grammars-themes that referenced this pull request Jan 29, 2024
* main:
  chore: improve playground (shikijs#19)
  feat: add fortran (free form) grammar (shikijs#18)
  chore: improve playground info display, close shikijs#20
@uncenter uncenter deleted the improve-playground branch January 30, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants