Trix: Does or will trix ever support font face or colors?

Created on 22 Feb 2017  Â·  4Comments  Â·  Source: basecamp/trix

Does or will trix ever support font face or colors?

Most helpful comment

You can add your own formatting attributes and toolbar buttons. Here's an example: https://jsfiddle.net/javan/egg7fgvv/

All 4 comments

You can add your own formatting attributes and toolbar buttons. Here's an example: https://jsfiddle.net/javan/egg7fgvv/

Are there any examples of adding drop down lists to toolbar? Also does it support modals?

@vedmant You can use a standard details html element. Here's the updated example:

https://jsfiddle.net/dimarosenberg/fehotky2/1/

P.S. There is an issue with the summary tag styles, because Trix’s stylesheets query by tag names, not classes (trix-toolbar .button_group button), so you can’t use the Trix’s default styles on non-button elements and do things like <summary class=“button”>.

@rosendi thanks for the example - it works great! Here is the output after saving:

<div><span style=\"color: red;\"> red text here </span></div>

Was wondering how you would render the inline style back to the user after sanitizing?

```ruby
<%= simple_format @text %>
````

The above seems to sanitize inline styles while leaving the span tag. Was wondering how you all manage to render colors back to the user after sanitizing>? Any pointers in this direction would be most appreciated.

UPDATE

I found a gem which allows for the quick white listing of inline style elements. it may be useful to you all. here it is: https://github.com/rgrove/sanitize

chrs

Ben

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madikarizma picture madikarizma  Â·  5Comments

divyenduz picture divyenduz  Â·  4Comments

marpstar picture marpstar  Â·  5Comments

pars0097 picture pars0097  Â·  4Comments

binchentx picture binchentx  Â·  5Comments