Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CSS Extraction at build-time #433

Open
@davesnx

Description

@davesnx

We can remove the runtime completely and go for static styles. Generate CSS files in the _build folder (for Melange/native) and in-source in ReScript.

  • We will remove the runtime completely allowing much faster implementation
  • Output real CSS (can be extracted to a new file, cached)
  • Dynamic components can be translated to CSS variables
  • We can have development type-safety if we keep the parsing/type-checking + inline styles at run-time? Not sure how thought, maybe with unboxed?
  • We already have a css-in-js logic implemented in native

Design

styled.div

moduleC= [%styled.div"height: 100%"](* pushes into the Stylesheet ".div12312 {height: 100%}"*)(* module C = <div className="div12312" />*)moduleC= [%styled.div (~what)=>"width: $(what); height: 100%"](* pushes static properties ".div12312 {height: 100%}"*)(* generates dynamic properties with CSS vars ".div12345 {width: (--var-what)}"*)(* module C = <div className="div12312 div12345" style={ReactDOM.Style.make("--var-what": what)} />*)

cx

let cx= [%cx"height: 100%"](* pushes properties ".hash {height: 100%}"*)(* let cx = ".hash"*)

Ideal plan

Similar implementations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp