Skip to content

Commit 05b24ef

Browse files
Merge pull request #5 from markusguenther/rename-project
TASK: Rename to for-react-css-themr
2 parents 790006b + b98b4ba commit 05b24ef

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
[![npm version](https://img.shields.io/npm/v/react-css-themr.svg?style=flat-square)](https://www.npmjs.com/package/react-css-themr)
2-
[![Build Status](http://img.shields.io/travis/javivelasco/react-css-themr/master.svg?style=flat-square)](https://travis-ci.org/javivelasco/react-css-themr)
3-
[![NPM Status](http://img.shields.io/npm/dm/react-css-themr.svg?style=flat-square)](https://www.npmjs.com/package/react-css-themr)
1+
[![npm version](https://img.shields.io/npm/v/for-react-css-themr.svg?style=flat-square)](https://www.npmjs.com/package/for-react-css-themr)
2+
[![Build Status](http://img.shields.io/travis/FriendsOfReactJS/for-react-css-themr/master.svg?style=flat-square)](https://travis-ci.org/FriendsOfReactJS/for-react-css-themr)
3+
[![NPM Status](http://img.shields.io/npm/dm/for-react-css-themr.svg?style=flat-square)](https://www.npmjs.com/package/for-react-css-themr)
44

5-
# React CSS Themr
5+
# Friends of react: React CSS Themr
6+
7+
```
8+
⚛️️️❗️❗️⚛️
9+
This is a fork of React CSS Themr, that is not maintained anymore. We thank Javi Velasco for all his efforts and for
10+
creating such a great package. This package should not be unmaintained - so the friends of react will continue.
11+
12+
Sadly Javi did not responed so we can not continue with the same package name. You find us now on npm with the prefix `for-`.
13+
```
614

715
Easy theming and composition for CSS Modules.
816

917
```
10-
$ npm install --save react-css-themr
18+
$ npm install --save for-react-css-themr
1119
```
1220

1321
**Note: Feedback and contributions on the docs are highly appreciated.**
@@ -22,7 +30,7 @@ Taking ideas from [future-react-ui](https://github.com/nikgraf/future-react-ui)
2230

2331
The most immediate way of providing a classname object is via *props*. In case you want to import a component with a theme already injected, you have to write a higher order component that does the job. This is ok for your own components, but for ui-kits like [React Toolbox](http://www.react-toolbox.com) or [Belle](http://nikgraf.github.io/belle/), you'd have to write a wrapper for every single component you want to use. In this fancy, you can understand the theme as a **set** of related classname objects for different components. It makes sense to group them together in a single object and move it through the component tree using a context. This way, you can provide a theme either via **context**, **hoc** or **props**.
2432

25-
The approach of react-css-themr consists of a *provider* and a *decorator*. The provider sets a context theme. The decorator adds to your components the logic to figure out which theme should be used or how should it be composed, depending on configuration, context and props.
33+
The approach of for-react-css-themr consists of a *provider* and a *decorator*. The provider sets a context theme. The decorator adds to your components the logic to figure out which theme should be used or how should it be composed, depending on configuration, context and props.
2634

2735
## Combining CSS modules
2836

@@ -41,7 +49,7 @@ Say you have a `Button` component you want to make themeable. You should pass a
4149
```jsx
4250
// Button.js
4351
import React, { Component } from 'react';
44-
import { themr } from 'react-css-themr';
52+
import { themr } from 'for-react-css-themr';
4553

4654
@themr('MyThemedButton')
4755
class Button extends Component {
@@ -80,7 +88,7 @@ If you use a component with a base theme, you may want to import the component w
8088
```jsx
8189
// SuccessButton.js
8290
import React, { Component } from 'react';
83-
import { themr } from 'react-css-themr';
91+
import { themr } from 'for-react-css-themr';
8492
import successTheme from './SuccessButton.css';
8593

8694
@themr('MySuccessButton', successTheme)
@@ -129,7 +137,7 @@ Although context theming is not limited to ui-kits, it's very useful to avoid de
129137
```jsx
130138
import React from 'react';
131139
import { render } from 'react-dom';
132-
import { ThemeProvider } from 'react-css-themr';
140+
import { ThemeProvider } from 'for-react-css-themr';
133141
import App from './app'
134142

135143
const contextTheme = {
@@ -174,4 +182,4 @@ Thanks to [Nik Graf](http://www.twitter.com/nikgraf) and [Mark Dalgleish](http:/
174182
175183
## License
176184
177-
This project is licensed under the terms of the [MIT license](https://github.com/javivelasco/react-css-themr/blob/master/LICENSE).
185+
This project is licensed under the terms of the [MIT license](https://github.com/FriendsOfReactJS/for-react-css-themr/blob/master/LICENSE).

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "react-css-themr",
3-
"description": "React CSS Themr",
4-
"homepage": "https://github.com/javivelasco/react-css-themr#readme",
2+
"name": "for-react-css-themr",
3+
"description": "Friends of ReactJS: React CSS Themr",
4+
"homepage": "https://github.com/FriendsOfReactJS/for-react-css-themr#readme",
55
"version": "2.1.2",
66
"main": "./lib",
77
"author": {
@@ -11,17 +11,19 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git+https://github.com/javivelasco/react-css-themr.git"
14+
"url": "git+https://github.com/FriendsOfReactJS/for-react-css-themr.git"
1515
},
1616
"bugs": {
17-
"url": "https://github.com/javivelasco/react-css-themr/issues"
17+
"url": "https://github.com/FriendsOfReactJS/for-react-css-themr/issues"
1818
},
1919
"keywords": [
2020
"css-modules",
2121
"customization",
2222
"react",
2323
"react-css-themr",
24-
"theming"
24+
"theming",
25+
"for-react-css-themr",
26+
"friends of react"
2527
],
2628
"dependencies": {
2729
"hoist-non-react-statics": "^1.2.0",

src/components/themr.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default (componentName, localTheme, options = {}) => (ThemedComponent) =>
9292
getNamespacedTheme(props) {
9393
const { themeNamespace, theme } = props
9494
if (!themeNamespace) return theme
95-
if (themeNamespace && !theme) throw new Error('Invalid themeNamespace use in react-css-themr. ' +
95+
if (themeNamespace && !theme) throw new Error('Invalid themeNamespace use in for-react-css-themr. ' +
9696
'themeNamespace prop should be used only with theme prop.')
9797

9898
return Object.keys(theme)
@@ -262,7 +262,7 @@ function merge(original = {}, mixin = {}) {
262262
function validateComposeOption(composeTheme) {
263263
if ([ COMPOSE_DEEPLY, COMPOSE_SOFTLY, DONT_COMPOSE ].indexOf(composeTheme) === -1) {
264264
throw new Error(
265-
`Invalid composeTheme option for react-css-themr. Valid composition options\
265+
`Invalid composeTheme option for for-react-css-themr. Valid composition options\
266266
are ${COMPOSE_DEEPLY}, ${COMPOSE_SOFTLY} and ${DONT_COMPOSE}. The given\
267267
option was ${composeTheme}`
268268
)

test/components/themr.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ describe('Themr decorator function', () => {
351351
<ProviderMock theme={theme}>
352352
<Container themeNamespace="container"/>
353353
</ProviderMock>
354-
)).toThrow(/Invalid themeNamespace use in react-css-themr. themeNamespace prop should be used only with theme prop./)
354+
)).toThrow(/Invalid themeNamespace use in for-react-css-themr. themeNamespace prop should be used only with theme prop./)
355355
})
356356

357357
it('when providing a themeNamespace prop composes a theme', () => {

0 commit comments

Comments
 (0)