Giter VIP home page Giter VIP logo

Comments (9)

nkbt avatar nkbt commented on July 17, 2024

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.

TCMiranda avatar TCMiranda commented on July 17, 2024

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)

  1. core.styl -> Used by components (doesn't print anything)
    • Variables -> Colors, sizes, etc..
    • Helpers -> Functions
  2. base.styl -> HTML5 Boilerplate + my generic styles (Uses core.styl)
    • Only html, no .classes or #ids
    • Required at my root component
  3. Components -> Require within the component (uses core.styl)
    • Prints the component styles

So, hope it helps somehow!

Thaks!

from elemental.

jossmac avatar jossmac commented on July 17, 2024

Just an update on this, it looks like we'll go with Radium

from elemental.

nkbt avatar nkbt commented on July 17, 2024

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.

LorbusChris avatar LorbusChris commented on July 17, 2024

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.

LorbusChris avatar LorbusChris commented on July 17, 2024

@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.

nkbt avatar nkbt commented on July 17, 2024

from elemental.

jossmac avatar jossmac commented on July 17, 2024

@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.

LorbusChris avatar LorbusChris commented on July 17, 2024

sure thing! Thank you @nkbt @jossmac

from elemental.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.