<p>I am running into an issue with Redactor in Craft and I am wondering if anyone can help me sort it out. I am trying to set up multiple rich text fields with different stylesheets connected to each. I've tried out the redactor styles plugin and while it does connect the custom stylesheet to the field, it only allows me to specify one stylesheet site-wide.I took a look at the redactor docs, and it looks like there is an option in the settings for specifying a custom stylesheet, but I can't find an example of how to implement it, and I've tried adding a line to my config but it doesn't work. Here's an example of what I tried in the config:</p>

<pre><code>{
buttons: ['html','formatting','bold','italic','link'],  
plugins: ['styles'],
toolbarFixed: true, 
stylesheet: "http://mysitedomain.com/assets/css/redactorStylesHeader.css"
}
</code></pre>

<p>The stylesheet item I saw in the docs is here: <a href="https://www.modmore.com/extras/redactor/documentation/configuration/#stylesheet" rel="nofollow">https://www.modmore.com/extras/redactor/documentation/configuration/#stylesheet</a></p>

<p>Am I not understanding the docs correctly? I was thinking that you could specify a stylesheet option with a url to the stylesheet you want to use and it would use it as a custom stylesheet in addition to what is loaded into redactor.</p>

<p>Can anyone help clarify this for me?</p>

<p>Thanks,</p>

<p>Brian</p>

CC BY-SA 3.0
2015-02-20T01:19:45.790Z
I'm voting to close this question as off-topic because this isn't specific to Craft CMS.
Anna_MediaGirl
CC BY-SA 3.0
2015-02-10T00:11:49.083Z
Where do you want to have different looking Redactor fields? In different sections? Matrix blocks?
carlcs
CC BY-SA 3.0
2015-02-10T00:31:53.143Z
You read the wrong docs. Redactor doesn't have a config setting for CSS in the JSON file without a plugin. (--> http://imperavi.com/redactor/docs)
carlcs
CC BY-SA 3.0
2015-02-11T00:43:24.043Z
yeah that's kind of what I figured. I'm just going to work around it as best I can. Thanks for getting back to me.
Brian Rivet
<redactor><css><custom>
Is it Possible to Connect a Custom Stylesheet to Redactor via the Config?
# Is it Possible to Connect a Custom Stylesheet to Redactor via the Config?

(Asked by: username_0 on 2015-02-09)

I am running into an issue with Redactor in Craft and I am wondering if anyone can help me sort it out. I am trying to set up multiple rich text fields with different stylesheets connected to each. I've tried out the redactor styles plugin and while it does connect the custom stylesheet to the field, it only allows me to specify one stylesheet site-wide.I took a look at the redactor docs, and it looks like there is an option in the settings for specifying a custom stylesheet, but I can't find an example of how to implement it, and I've tried adding a line to my config but it doesn't work. Here's an example of what I tried in the config:
{
buttons: ['html','formatting','bold','italic','link'],  
plugins: ['styles'],
toolbarFixed: true, 
stylesheet: "http://mysitedomain.com/assets/css/redactorStylesHeader.css"
}

The stylesheet item I saw in the docs is here: https://www.modmore.com/extras/redactor/documentation/configuration/#stylesheet
Am I not understanding the docs correctly? I was thinking that you could specify a stylesheet option with a url to the stylesheet you want to use and it would use it as a custom stylesheet in addition to what is loaded into redactor.
Can anyone help clarify this for me?
Thanks,
Brian

**Tags:** redactor, css, custom
> **Comments:**
> **username_2**: Where do you want to have different looking Redactor fields? In different sections? Matrix blocks?  
> **username_2**: You read the wrong docs. Redactor doesn't have a config setting for CSS in the JSON file without a plugin. (--> http://imperavi.com/redactor/docs)  
> **username_0**: yeah that's kind of what I figured. I'm just going to work around it as best I can. Thanks for getting back to me.  
> **username_1**: I'm voting to close this question as off-topic because this isn't specific to Craft CMS.  

---

## 0 answers

