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

Add paragraph alignment tunes #92

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,21 @@ The Paragraph Tool supports these configuration parameters:
| ----- | -------- | ------------------ |
| placeholder | `string` | The placeholder. Will be shown only in the first paragraph when the whole editor is empty. |
| preserveBlank | `boolean` | (default: `false`) Whether or not to keep blank paragraphs when saving editor data |
| defaultAlignment | `left|center|right` | (default: `left`) Where should be aligned the by default the paragraph text |

## Output data

| Field | Type | Description |
| ------ | -------- | ---------------- |
| text | `string` | paragraph's text |

| Field | Type | Description |
| ------ | -------- | ---------------- |
| text | `string` | paragraph's text |
| alignment | `left|center|right` | paragraph's alignment |

```json
{
"type" : "paragraph",
"data" : {
"text" : "Check out our projects on a <a href=\"https://github.com/codex-team\">GitHub page</a>.",
"alignment": "left"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"vite-plugin-dts": "^3.9.1"
},
"dependencies": {
"@codexteam/icons": "^0.0.4"
"@codexteam/icons": "^0.3.0"
}
}
12 changes: 12 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
line-height: 1.6em;
outline: none;
}
.ce-paragraph--right {
text-align: right;
}
.ce-paragraph--center {
text-align: center;
}
.ce-paragraph--left {
text-align: left;
}
.ce-paragraph--justify {
text-align: justify;
}

/**
* Normally paragraph placeholder is shown only for the focused block (thanks to "data-placeholder-active").
Expand Down
Loading