Skip to content

Instantly share code, notes, and snippets.

@easylogic
Created March 1, 2022 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easylogic/88ee69ebfc333b083c944c0035c1fdf1 to your computer and use it in GitHub Desktop.
Save easylogic/88ee69ebfc333b083c944c0035c1fdf1 to your computer and use it in GitHub Desktop.
css language architecture

CL - CSS Language

.A {  // class A 

  // initialize 
  
  // private
   --value: 10;
   
   background-color: red; 
   color: rgba(var(--value, 255), 255, 255, 0.1);
   
   // new layer with layer class 
   .layer {
      height: 100px;
      width: 200px;
   }
   #my-layer {
    background-color: yellow;
    
    [onClick] { e => 
      background-color: red;
    })
   }
   
   
}

result

class A {
    '.layer': new Layer();
    '#my-layer' : new MyLayer();
}

class MyLayer {
  onClick: (e) => {
    this.$el.cssText`
      background-color: red;
    `
  }
}

<div class="A">
  <div class="layer"></div>
    <div id="my-layer></div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment