re: Universal next gen css-in-js library in under 1kb VIEW POST

FULL DISCUSSION
 

This is very cool!

I was thinking about this the other day while using hyperapp. I wondered if we can remove the need for strings, and possibly include a ‘style’ tag in/as JSX which then can be converted into that string to be used with this library. For a better syntax than string templates.

 

Thinking abut it a little more.. CSS uses brackets {} which are also used for expressions in JSX.. maybe there is a better alternative.

I always wondered how Vue implements it's Single File Component

for example this vue file:

<template>
  <h1> {{msg}} </h1>
</template>

<script>
  export default {
     data () {
       return {
         msg:"hi there!"
       }
     }
  }
</script>

<style>
  h1{
    font-size: 45px
  }
</style>

I bet Vue has it's own file loader/parser to extract all the template, script and css then scope that css. Because this file isn't JSX or any other nodejs library I know of...

Anyway, just thoughts.. need to research more :)

 
 
code of conduct - report abuse