<commit_before># ChameleonElement jQuery Plugin 0.3
Build fluid interfaces for apps that need to inherit CSS properties of another class.

* Alert: This plugin uses another plugin called [attrchange](https://github.com/meetselva/attrchange) created by meetselva *

![](http://i.imgur.com/8FoyRmq.gif)

---
## Why Chameleon?
Even when you don't need to use the real time feature of Chameleon, it prevents you to repeat a lot of code and save a lot of classes (for each background color, border color etc).

For example, imagine a side-nav that needs to change its 'color' and 'border-color' according to the '.top-bar' background-color. You can't use a single class '.red' to these elements because side-nav can't have a red background. So, basically, you would have to create classes like '.red-bg', '.red-text', '.red-border' for each color of your UI and in each page changes all the classes of all elements. With Chameleon, this is much easier and it's realtime (perfect for SPA)!

### Without Chameleon:
```html
<div class="top-bar red-bg white-text">Topbar</div>
<ul>
	<li class="is-selected red-text">Option</li>
</ul>
```

And in other pages, you would have to repeat the process...

```html
<div class="top-bar blue-bg white-text">Topbar</div>
<ul>
	<li class="is-selected blue-text">Option</li>
</ul>
```

A lot of different classes, a lot of work, right? Automate this using ChameleonClass.

---

### With Chameleon (any kind of property):
```html
<div class="top-bar red-bg white-text">Topbar</div>
<ul class="chameleon">
	<li class="is-selected"> Option </li>
</ul>
```

## How to use
### jQuery
```js
$('.chameleon').each(function(){
	$(this).chameleonElement({<commit_msg>README improvements<commit_after># ChameleonElement jQuery Plugin 0.3
Build fluid interfaces for apps that need to inherit CSS properties of another class.

* Alert: This plugin uses another plugin called [attrchange](https://github.com/meetselva/attrchange) created by meetselva *

![](http://i.imgur.com/8FoyRmq.gif)

---
## Why Chameleon?
Even when you don't need to use the real time feature of Chameleon, it prevents you to repeat a lot of code and save a lot of classes (for each background color, border color etc).

For example, imagine a side-nav that needs to change its 'color' and 'border-color' according to the '.top-bar' background-color. You can't use a single class '.red' to these elements because side-nav can't have a red background. So, basically, you would have to create classes like '.red-bg', '.red-text', '.red-border' for each color of your UI and in each page changes all the classes of all elements. With Chameleon, this is much easier and it's realtime (perfect for SPA)!

### Without Chameleon:
```html
<div class="top-bar red-bg white-text">Topbar</div>
<ul>
	<li class="is-selected red-text red-border">Option</li>
</ul>
```

What if your top-bar changes its background-color each page? You would have to create a lot of classes.
What if your top-bar changes its background-color in page? You would have to create a kinda messy JS.
And in other pages, you would have to repeat the process...

Automate this using ChameleonClass.

---

### With Chameleon (any kind of property):
```html
<div class="top-bar red-bg white-text">Topbar</div>
<ul class="chameleon">
	<li class="is-selected"> Option </li>
</ul>
```

## How to use
### jQuery
```js
$('.chameleon').each(function(){
	$(this).chameleonElement({
{'fraction_non_alphanumeric': 0.12627886582870507, 'fraction_numerical': 0.0017538731365097924, 'mean_word_length': 4.423137876386688, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '275235', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1039, 'n_words': 449}