flute icon indicating copy to clipboard operation
flute copied to clipboard

styles loader for "tailwind" css

Open naturallymitchell opened this issue 6 years ago • 12 comments

for current theme, class/body.txt,

bg-grey-light
font-sans
leading-normal
tracking-normal

would output as https://github.com/foundpatterns/base-theme/blob/165d95e5d06065e4ccc016d780bf344b99b0307a/base.html#L65

load each tag/tagged-id 's txt file serialize the table with an arg separator, in this case a space similar to the events.txt load them as a list, then output them to the html tag classes string

we need to have id's for every tag

naturallymitchell avatar Nov 21 '18 02:11 naturallymitchell

has to work with both semantic tags and tag ids _class/base.html-body.txt

font-sans
leading-normal
tracking-normal

the _class/ folder is a sibling folder to the template with the "template class" files (that end in .txt)

naturallymitchell avatar Dec 20 '18 04:12 naturallymitchell

after theme loader creates temp-theme/ find every "template class" and patch its template's class

naturallymitchell avatar Dec 20 '18 04:12 naturallymitchell

Tthe class file name must be _class/base.html-body.txt

  • _class to make it explicit that it's a special directory
  • base.html says that the classes apply to elements of that file
  • body is the element to wich the classes are applied

Arnaz87 avatar Dec 20 '18 04:12 Arnaz87

has to work on any element both semantic tags and tags with an id

naturallymitchell avatar Dec 20 '18 04:12 naturallymitchell

to indicate an element id, we could do the css way and name the file base.html-#myid.txt (note the numeral sign)

Arnaz87 avatar Dec 20 '18 04:12 Arnaz87

for the body element: base.html-body.txt fot the element with "body" as id: base.html-#body.txt

Arnaz87 avatar Dec 20 '18 04:12 Arnaz87

there's no ambiguity because the # character isn't allowed in element tag names

Arnaz87 avatar Dec 20 '18 04:12 Arnaz87

also, there's no need to specify the tag name and the element id at the same time because html documents can't have two elements with the same id

Arnaz87 avatar Dec 20 '18 04:12 Arnaz87

After #106, allow _class directories in any subdirectory of the theme

Arnaz87 avatar Dec 20 '18 05:12 Arnaz87

it's only working with tag names, not id names. my-theme shows this; only <p> gets the classes, not <div id="p">

also what about subdirectories?

naturallymitchell avatar Jan 04 '19 05:01 naturallymitchell

inheritance isn't working

naturallymitchell avatar Jan 11 '19 00:01 naturallymitchell

needs finalizing changes: are we going to keep the divergent XML syntax where id attribute name is implict?.. needs review needs docs it works very well though now :)

naturallymitchell avatar Apr 17 '19 13:04 naturallymitchell