question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Text align justify

See original GitHub issue

I would like to be able to add three buttons (text align left, text align justify, text align right).

Is this possible with the current version of trix?

Is there anyway to pass a class to a blockAttribute?

All I was able to do, was add a new textAttribute that has a custom tagName, which I can then style through CSS (display: block; text-align: justify;).

Trix.config.textAttributes.textAlignJustify = { tagName: 'div-text-align-justify' }

The problem with custom HTML tags is browser support. Because although it’s defined in HTML 5, only Chrome (and Opera) provide support.

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

43reactions
MartinMcDermidcommented, Dec 4, 2018

Would love to see this implemented!

13reactions
jeisslercommented, Nov 6, 2019

Unfortunately text alignment is a very standard option which is missing from trix entirely—I see this is now a pretty old issue, but is what will keep us from using trix for our editor capability.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS text-align property - W3Schools
The text-align property specifies the horizontal alignment of text in an element. Show demo ❯. Default value: left if direction is ltr, and...
Read more >
text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align property is specified in one of the following ways: Using the keyword values start , end , left , right ,...
Read more >
Align or justify text - Microsoft Support
Click anywhere in the paragraph that you want to justify. On the Home tab, in the Paragraph group, click Justify Text Justify text...
Read more >
Centered, Justified, Right Aligned Text Style Example
We use the CSS text-align property to align content inside a block-level element. Examples of block-level elements are paragraphs ( <p>.
Read more >
text-justify | CSS-Tricks
The text-justify property in CSS is a companion to the text-align property that is used to set the justification method of text when ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found