DEV Community

Discussion on: Universal next gen css-in-js library in under 1kb

Collapse
 
ahmedmusallam profile image
Ahmed Musallam

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 :)

Collapse
 
sadick profile image
Sadick

You are right Vue has a parser

Collapse
 
equinusocio profile image
Mattia Astorino

Just html, css and js. No more abstractions