Skip to content

Commit

Permalink
Merge pull request #12 from IgnaceMaes/fix-header-overflow
Browse files Browse the repository at this point in the history
fix: wrap filename on overflow
  • Loading branch information
IgnaceMaes authored Jan 28, 2024
2 parents eef7707 + dec13da commit 32b2f52
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-zebras-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ember-showdown-shikiji": patch
---

fix: wrap filename on overflow
23 changes: 9 additions & 14 deletions ember-showdown-shikiji/src/styles/shikiji.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pre.shiki {
Menlo,
monospace;
border-bottom: 1px solid var(--code-line-numbers-color);
word-break: break-all;
display: flex;
justify-content: space-between;
}

.filename + pre {
Expand All @@ -58,23 +61,15 @@ code.line-numbers .line::before {
}

/* Ribbons */
.filename.javascript::after,
.filename.js::after,
.filename.glimmer-js::after,
.filename.gjs::after,
.filename.typescript::after,
.filename.ts::after,
.filename.glimmer-ts::after,
.filename.gts::after,
.filename.handlebars::after,
.filename.hbs::after {
position: absolute;
.filename::after {
position: relative;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
top: 0.625rem;
bottom: 0.625rem;
right: 0;
margin-top: -0.125rem;
margin-bottom: -0.125rem;
right: -1rem;
padding-left: 1.5rem;
padding-right: 1rem;
color: var(--code-background-color);
Expand Down
7 changes: 7 additions & 0 deletions test-app/public/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ function greet() {
</template>
```

Adding a `javascript` as a language to get syntax highlighting
```gts {data-filename=app/components/deeply/nested/so/it/overflows/example.gts}
<template>
<p>Hello world!</p>
</template>
```

Now let's do something a bit more complex

```handlebars {data-filename=app/templates/blog-post.hbs}
Expand Down

0 comments on commit 32b2f52

Please sign in to comment.