Comments (9)
Hi, @TCMiranda you basically just named our major concerns about assets. We have just discussed those yesterday and hopefully they will be resolved soon.
Including styles in the component itself has some implications. There is an issue opened asking for the opposite thing #1 =)
from elemental.
Hi @nkbt
Thanks very much, I can see, so, my opinion
I think that it is great to offer the styles when you are building some ui package, really makes sense, but the components are raw without requiring css
As in ReactJS Why React
Build Composable Components
React is all about building reusable components. In fact, with React the only thing you do is build components. Since they're so encapsulated, components make code reuse, testing, and separation of concerns easy.
Another example is Polymer, which follows principles of web components, reusable and self-contained, defining the HTML, CSS and JS inside the component
The css "bootstrap" may be a great feature, but the components are something else, i can't find a reason to not make them work out of the box.
In my projects i follow the structure (with stylus, but could be less)
- core.styl -> Used by components (doesn't print anything)
- Variables -> Colors, sizes, etc..
- Helpers -> Functions
- base.styl -> HTML5 Boilerplate + my generic styles (Uses core.styl)
- Only html, no .classes or #ids
- Required at my root component
- Components -> Require within the component (uses core.styl)
- Prints the component styles
So, hope it helps somehow!
Thaks!
from elemental.
Just an update on this, it looks like we'll go with Radium
from elemental.
Going with pure JS styles solution has noticeable downsides. As well as going old good css way. So far the best what worked out is a combination of https://github.com/css-modules/css-modules for purely visual styling and plain js styles for state-related styling.
But the problem we have here is packaging. We cannot rely on all consumers using Webpack. There are heaps of folks using bower, browserify, sprockets, plain old <script>
tags. Real challenge is to find a universal solution that will not break existing developer's environment.
I definitely have some ideas how to solve this in a long term and will make some initial prototype hopefully quite soon.
from elemental.
Have you heard about the myth css preprocessor? www.myth.io
Whats your opinion on that?
Its supposed to work like a CSS polyfill, and it uses the W3C proposed syntax for future versions of CSS.
Edit: See www.cssnext.io as well. Apparantly it is similar and it claims to be faster than myth
Edit2: I've read a bit about radium and it seems to be quite a good fit :)
from elemental.
@jossmac could you clarify, please. are you going with radium or sticking with less? I'd personally favor radium now, but if you stick with less I will do the same. Thanks =)
from elemental.
from elemental.
@LorbusChris we'll likely transition the components to Radium when there's time, and like @TCMiranda mentioned leave CSS to do the things it's good at like resets, grids, etc.
The thing is we also maintain KeystoneJS and TouchstoneJS, not to mention the full-time commercial business Thinkmill.
So if you're up for it we welcome pull requests, but otherwise please be patient π
N.B. this issues has been resolved so please continue any discussion related to CSS, LESS, Radium etc. over on #1
from elemental.
sure thing! Thank you @nkbt @jossmac
from elemental.
Related Issues (20)
- v-for (el-form-item), rules εͺζζΎη€Ί δ½ζΆδΈεε» HOT 1
- <Modal> animation tends to flicker after closing HOT 2
- <Modal> this.props.backdropClosesModal is ignored
- Create contribution.md HOT 2
- Create a Roadmap document
- Dropdown item onClick not firing when clicked HOT 5
- How does one pull from git rather than npm (for latests code) HOT 8
- Doesn't work with React 16 HOT 4
- Modal leaves overflow:hidden on body HOT 1
- Can't find module elemental HOT 1
- How do I build the latest version HOT 1
- Runtime errors occur when importing Glyph or FormIconField components
- Runtime error when autoFocus applied to FormInput element HOT 1
- Normal usage issue
- Problem with adding 'elemental-ui' to React app with Webpack 4 HOT 1
- Website example show wrong words
- Website link jump to wrong site
- This project has been added to the react-ui-roundup
- TypeError: Cannot read property 'node' of undefined HOT 2
- Website not secured.
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 elemental.