# How can I whitelist a class in a theme?

**URL:** <https://meta.discourse.org/t/how-can-i-whitelist-a-class-in-a-theme/79520>\
**Category:** Development\
**Created:** [1 בפברואר,‏ 2018,‏ 4:18am UTC](https://meta.discourse.org/t/how-can-i-whitelist-a-class-in-a-theme/79520 "2018-02-01T04:18:54Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [1 בפברואר,‏ 2018,‏ 4:18am UTC](https://meta.discourse.org/t/how-can-i-whitelist-a-class-in-a-theme/79520/1 "2018-02-01T04:18:54Z")

</div>

I have a working carousel which I would like to package as a theme:

 ![](https://global.discourse-cdn.com/meta/original/3X/d/2/d22a48379b1a7222d9414b6ae9ee01dfa06b6f0c.gif)

I’ve been trying to figure out how to whitelist a class or attribute for the script to target that would work with under a theme.

I’ve read:

[https://meta.discourse.org/t/whitelisting-some-html-tags/24280](https://meta.discourse.org/t/whitelisting-some-html-tags/24280)

and

[Whitelist all the code inside of a div tag? - #4 by Alex\_Rabolin](https://meta.discourse.org/t/whitelist-all-the-code-inside-of-a-div-tag/51391/4)

But these topics cover plugin structure and I could not get any of the methods to work in a theme.

I’ve used the `[dir]` attribute - white-listed by default - in another theme [here](https://meta.discourse.org/t/discourse-masonry-gallery-theme-component/79076)

However, that won’t work for two reasons:

1- the Next and Previous buttons will be mixed up based on the text direction  
2- The slides can contain text like so:

 ![slideshow](https://global.discourse-cdn.com/meta/original/3X/9/9/991558b60814588064e68db7e079ea39e4f0dce6.gif)

and I’d really rather not go down that rabbit hole where I override the text direction with CSS - that’s just too hacky even for me.

I’m pretty much stuck here 😅

The current selector I’m using to initialize the script on the container is:

```plaintext
$('.cooked>div[dir*="rtl"]')

```

* * *

So my question is:

**How can I while-list a class or attribute for a div in a theme?**

---

_[View the full topic](https://meta.discourse.org/t/how-can-i-whitelist-a-class-in-a-theme/79520)._
