Comments (3)
Hey, @kirillvolkovich! Thanks for the kind words, and we're excited you're deriving inspiration from our CSS-in-JavaScript styleguide. Let me try to address your questions.
-
Our two styleguides will likely never overlap other than in the sense that they are two styleguides about CSS.
- BEM is a philosophy we prescribe to when writing traditional stylesheets because it helps build organizational hierarchies between CSS and HTML when in reality are none (in other words: it's CSS, you can name your classes whatever you want, and HTML tags know nothing about CSS classes).
- Following a similarly prescriptive naming scheme when writing CSS in JavaScript, especially in the context of React components, isn't quite as necessary because there are real hierarchies and real encapsulation. That being said, we do have a couple of “BEM-like” recommendations for CSS-in-JS that you'll find here.
-
Our implementation of
react-with-styles
does support theming, and we are currently using it in production. Theming is accomplished through the use ofThemedStyleSheet.registerTheme
and subsequently theThemeProvider
component. The documentation for these utilities is here, but let us know if you need clarification. -
We don't have any sort of “versioning” of components beyond the fact that we ship our internal UI components as an NPM package that uses versioning.
-
Internally we use (React Storybook](https://getstorybook.io/), with a slew of custom enhancements, for cataloging our components. It has been working okay for our current purposes.
Thanks for the link to your project! We'll take a look.
from react-with-styles.
Thanks for quick answer. I have read documentation. It is good-written)
We don't have any sort of “versioning” of components beyond the fact that we ship our internal UI components as an NPM package that uses versioning.
We of course too ship our internal UI components as an NPM package.
Problem is in another plain. Classic BEM naming don't ask question - what will be happened in this situation.
I just explain.
- root-component
- tab1
- some-input-v1
- modal-dialog
- some-input-v2
- some-input-v2
- tab2
- some-input-v3
- some-input-v3
- tab1
All versions of <SomeInput />
can have different styles with same class names.
Some of these classes sometimes break another because there are several same class definitions at one page which can merge in unpredictable way. Upgrade component can be not trivial procedure because you have no any guarantee to all will works well after component update.
Maybe it is our project-specific problem and we do something wrong as we have a little npm dependency hell.
Approaches like css-in-js/css-modules looks like can solve this problem)
By some reasons we use different versions of components at project and we want to any team-member can watch actual documentation to any component version.
Do not bother 😃 Have a nice day.
from react-with-styles.
@kirillvolkovich, we have definitely found that writing CSS in our React components results in fewer CSS breakages, for the reasons you mentioned. Even with react-with-styles
, it can be tricky to update a component that is used in 50+ places across a codebase, so I totally understand what you're saying 😉
from react-with-styles.
Related Issues (20)
- An in-range update of enzyme is breaking the build 🚨 HOT 8
- How can I access child functions? HOT 1
- An in-range update of babel-preset-airbnb is breaking the build 🚨 HOT 2
- How to write hover effect HOT 1
- Contextualized theme ? HOT 1
- An in-range update of enzyme is breaking the build 🚨 HOT 1
- How can I return a react component using withStyles? HOT 2
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 2
- Provide a `useStyles` method for using with React Hooks API HOT 5
- An in-range update of eslint-plugin-import is breaking the build 🚨 HOT 2
- An in-range update of eslint-plugin-jsx-a11y is breaking the build 🚨 HOT 2
- .git included in npm distribution in version 3.2.2 HOT 4
- how to get styles object into class type component that extends React.component HOT 5
- An in-range update of eslint-plugin-import is breaking the build 🚨 HOT 3
- Uncaught TypeError: Super expression must either be null or a function HOT 1
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 2
- Selectors in CSS/JS not working as expected
- Context provider does not provide the interface HOT 1
- Add testing on React 17, once Enzyme has an adapter for it
- how to access children styles HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-with-styles.