<commit_before># rjss
CSS style syntax for creating inlineable style objects for react-native and react-canvas. RJSS files are precompiled to javascript.

## Documentation

### Basic syntax
```css
/* simple.rjss */
main {
  top: 10;
  left: 0;
  width: 100;
  height: 20;
  margin-top: 20;
  margin-bottom: 30;
}
```
usage
```js
var styles = require('./simple.rjss');

...
  render: function () {
    return <View style={styles('main')} />;
  }
...

```

### Runtime variables
```css
/* variables.rjss */
main {
  top: $top;
  left: $left;
  width: 100;
  height: 20;
  margin-top: 20;
  margin-bottom: 30;
}
```
usage
```js
var styles = require('./variables.rjss');

...
  render: function () {
    return <View style={styles('main', {top: 10, left: 10})} />;
  }
...

```
### Defining variables in RJSS
```css
/* variables.rjss */

@var top: 100;

main {
  top: $top;
  left: $left;
  width: 100;
  height: 20;
  margin-top: 20;
  margin-bottom: 30;
}
```
usage
```js
var styles = require('./variables.rjss');

...
  render: function () {
    return <View style={styles('main', {left: 10})} />;
  }
...

or

...
  render: function () {
    // This will override the top variable set in the rjss file
    return <View style={styles('main', {top: 20, left: 10})} />;
  }
...

```
### Inheritance
```css
/* buttons.rjss */

button {
  width: 100;
  height: 20;
}

green extends button {
  backgroundColor: "#00FF00"
}

red extends button {
  backgroundColor: "#FF0000"
}

blue extends button {
  backgroundColor: "#0000FF"
}

```
usage
```js
var buttons = require('./buttons.rjss');

...
  render: function () {
    return <View>
      <View style={styles('red')} />
      <View style={styles('green')} />
      <View style={styles('blue')} />
    </View>;
  }
...

```
### Defining functions in RJSS
```css
/* functions.rjss */

@var top: 100;

@func random (min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

@func topToPowerOf (powerOf) {
  return Math.pow(top, powerOf);
}

main {
  left: random(1, 100);
  top: topToPowerOf(2);
}
```
usage
```js
var styles = require('./functions.rjss');

...
  render: function () {
    return <View style={styles('main')} />;
  }
...

```

### Import other RJSS files

```css
/* variables.rjss */

@var brandColor: "#ff00ff";
@var smallText: 10;
@var mediumText: 15;
@var largeText: 20;
```

```css
/* other.rjss */

@import "./variables.rjss";

header {
  fontSize: $largeText;
  color: $brandColor;
}

```<commit_msg>Use hyphen to demonstrate hyphen to camelcase conversion<commit_after># rjss
CSS style syntax for creating inlineable style objects for react-native and react-canvas. RJSS files are precompiled to javascript.

## Documentation

### Basic syntax
```css
/* simple.rjss */
main {
  top: 10;
  left: 0;
  width: 100;
  height: 20;
  margin-top: 20;
  margin-bottom: 30;
}
```
usage
```js
var styles = require('./simple.rjss');

...
  render: function () {
    return <View style={styles('main')} />;
  }
...

```

### Runtime variables
```css
/* variables.rjss */
main {
  top: $top;
  left: $left;
  width: 100;
  height: 20;
  margin-top: 20;
  margin-bottom: 30;
}
```
usage
```js
var styles = require('./variables.rjss');

...
  render: function () {
    return <View style={styles('main', {top: 10, left: 10})} />;
  }
...

```
### Defining variables in RJSS
```css
/* variables.rjss */

@var top: 100;

main {
  top: $top;
  left: $left;
  width: 100;
  height: 20;
  margin-top: 20;
  margin-bottom: 30;
}
```
usage
```js
var styles = require('./variables.rjss');

...
  render: function () {
    return <View style={styles('main', {left: 10})} />;
  }
...

or

...
  render: function () {
    // This will override the top variable set in the rjss file
    return <View style={styles('main', {top: 20, left: 10})} />;
  }
...

```
### Inheritance
```css
/* buttons.rjss */

button {
  width: 100;
  height: 20;
}

green extends button {
  background-color: "#00FF00"
}

red extends button {
  background-color: "#FF0000"
}

blue extends button {
  background-color: "#0000FF"
}

```
usage
```js
var buttons = require('./buttons.rjss');

...
  render: function () {
    return <View>
      <View style={styles('red')} />
      <View style={styles('green')} />
      <View style={styles('blue')} />
    </View>;
  }
...

```
### Defining functions in RJSS
```css
/* functions.rjss */

@var top: 100;

@func random (min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

@func topToPowerOf (powerOf) {
  return Math.pow(top, powerOf);
}

main {
  left: random(1, 100);
  top: topToPowerOf(2);
}
```
usage
```js
var styles = require('./functions.rjss');

...
  render: function () {
    return <View style={styles('main')} />;
  }
...

```

### Import other RJSS files

```css
/* variables.rjss */

@var brandColor: "#ff00ff";
@var smallText: 10;
@var mediumText: 15;
@var largeText: 20;
```

```css
/* other.rjss */

@import "./variables.rjss";

header {
  font-size: $largeText;
  color: $brandColor;
}

```
{'fraction_non_alphanumeric': 0.2031530632608262, 'fraction_numerical': 0.030732388744761526, 'mean_word_length': 3.0814332247557004, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, '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': '2688442', 'n_tokens_mistral': 2040, 'n_tokens_neox': 1842, 'n_words': 489}