Skip to content

Commit

Permalink
style: inline code
Browse files Browse the repository at this point in the history
  • Loading branch information
aolyang committed Dec 12, 2024
1 parent 20657d7 commit a66740f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 10 additions & 0 deletions example/src/styles/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
height: 0;
pointer-events: none;
}
// inline code
.tiptap code.inline-code {
background-color: rgba(0, 0, 0, 0.1);
padding: 3px 6px;
border-radius: 4px;
}
.dark .tiptap code.inline-code {
background-color: rgb(89, 89, 89);
}


// task modules
@import url("./editor-styles/table.scss");
Expand Down
8 changes: 1 addition & 7 deletions example/src/utils/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ export const extensions: Extensions = [
types: horizontalTypes
}),
Bold.extend({ renderHTML: ({ HTMLAttributes }) => ["b", HTMLAttributes, 0] }),
Code.configure(attrs({
style: css`
padding: 2px 6px;
border-radius: 3px;
background-color: ${lowContrastBg};
`
})),
Code.configure(attrs({ class: "inline-code" })),
Sub,
Sup,
Link.configure(attrs({
Expand Down

0 comments on commit a66740f

Please sign in to comment.