Skip to content

Commit

Permalink
refactor: add CSS-Variables to adjust font-sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasHeimGalindo committed Jan 18, 2024
1 parent b0aada3 commit 89164b5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
/**
@prop --ino-markdown-editor-min-height: min-height of text editor. Default value is `100px`.
@prop --ino-markdown-editor-max-height: max-height of text editor Default value is `none`.
@prop --ino-markdown-editor-paragraph-font-size: Font size of paragraph text. Default value is `16px`.
@prop --ino-markdown-editor-h1-font-size: Font size of H1 headers. Default value is `32px`.
@prop --ino-markdown-editor-h2-font-size: Font size of H2 headers. Default value is `28px`.
*/

// specific styles for the markdown editor dialog window that opens when having text selected and clicking the "create link" button
Expand Down Expand Up @@ -149,6 +153,15 @@ ino-markdown-editor {
border-radius: 4px;
border: 1px solid theme.$n-2;
color: rgba(0, 0, 0, 0.87);
font-size: var(--ino-markdown-editor-paragraph-font-size, 1rem);

h1 {
font-size: var(--ino-markdown-editor-h1-font-size, 2rem);
}

h2 {
font-size: var(--ino-markdown-editor-h2-font-size, 1.75rem);
}

&:hover:not(&-focused) {
border-color: theme.$n-4;
Expand Down
11 changes: 7 additions & 4 deletions packages/elements/src/components/ino-markdown-editor/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ The **Markdown Mode** supports all syntax of [CommonMark](https://commonmark.org

## CSS Custom Properties

| Name | Description |
| ---------------------------------- | ---------------------------------------------------- |
| `--ino-markdown-editor-max-height` | max-height of text editor Default value is `none`. |
| `--ino-markdown-editor-min-height` | min-height of text editor. Default value is `100px`. |
| Name | Description |
| ------------------------------------------- | ----------------------------------------------------- |
| `--ino-markdown-editor-h1-font-size` | Font size of H1 headers. Default value is `32px`. |
| `--ino-markdown-editor-h2-font-size` | Font size of H2 headers. Default value is `28px`. |
| `--ino-markdown-editor-max-height` | max-height of text editor Default value is `none`. |
| `--ino-markdown-editor-min-height` | min-height of text editor. Default value is `100px`. |
| `--ino-markdown-editor-paragraph-font-size` | Font size of paragraph text. Default value is `16px`. |


## Dependencies
Expand Down
15 changes: 15 additions & 0 deletions packages/storybook/elements-stencil-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6401,6 +6401,16 @@
}
],
"styles": [
{
"name": "--ino-markdown-editor-h1-font-size",
"annotation": "prop",
"docs": "Font size of H1 headers. Default value is `32px`."
},
{
"name": "--ino-markdown-editor-h2-font-size",
"annotation": "prop",
"docs": "Font size of H2 headers. Default value is `28px`."
},
{
"name": "--ino-markdown-editor-max-height",
"annotation": "prop",
Expand All @@ -6410,6 +6420,11 @@
"name": "--ino-markdown-editor-min-height",
"annotation": "prop",
"docs": "min-height of text editor. Default value is `100px`."
},
{
"name": "--ino-markdown-editor-paragraph-font-size",
"annotation": "prop",
"docs": "Font size of paragraph text. Default value is `16px`."
}
],
"slots": [],
Expand Down

0 comments on commit 89164b5

Please sign in to comment.