Giter Site home page Giter Site logo

thymesheet's People

Contributors

4dz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dretch

thymesheet's Issues

Feature request: when more than one attribute with the same name applies to a single element, throw an exception instead of just using the last one

Consider Thymesheet files with duplicate attributes, like:

a {
  th-class: "firstClass";
  th-class: "secondClass";
}

or, even something like:

a {
  th-class: "firstClass";
}
* {
  th-class: "secondClass";
}

More than once I have seen people expect this sort of thing to work (by expecting ThymeLeaf/Sheet to combine the attributes), but instead only the last attribute that applies to an element will be used, and the others ignored.

I think both of the above cases should result in exceptions (and they will probably require different bits of code to be changed to implement each of them). Do you agree?

Feature Request: Allow Sass style syntax

It would be nice to be able to use a Sass-style syntax for Thymesheet.

E.g. instead of:

a b { .. }
a b c { ... }
a b c d { ... }
a b c e { ... }

Allow:

a b {
  c {
    d { ... }
    e { ... }
  }
}

This would reduce the amount of selector duplication in Thymesheet files.

Thymesheet equivalent to th:block

Some kind of :pseudo syntax for wrapping elements (so we can iterate over them, primarily); equivalent to th:block

An example would be a table where we want to repeat the first two rows;

<table>
  <tr><td>Name</td></tr>
  <tr><td>Address</td></tr>

  <tr><td>Name 2</td></tr>
  <tr><td>Address 2</td></tr>
</table>

(Loosely based on the Thymeleaf 2.1 example)

Thymeleaf lets you add a block to this e.g.

<table data-th-remove="all-but-first">
  <th:block data-th-each="dude : ${addressBook}">
    <tr><td>Name</td></tr>
    <tr><td>Address</td></tr>
  </th:block>

  <tr><td>Name 2</td></tr>
  <tr><td>Address 2</td></tr>
</table>

The solution I'm toying with is something like a :wrap pseudo-class where, :wrap will wrap an element; or optionally, an element and its following elements.

So e.g. to get the first two rows in a table, and wrap them in a block;

table tr:first-child:group(2) {
tagname: "th:block";
th-each: "dude : ${addressBook}"
}

table {
data-th-remove: "all-but-first";
}

WARNING… modifying the dom will depend on the order that the dom is modified!! So to get around that, the injected th:block would be wrapped in a Thymeleaf prototype-only comment block, e.g.

<!--/*/ <th:block th:each="dude : ${addressBook}"> /*/-->
    <tr><td>Name</td></tr>
    <tr><td>Address</td></tr>
<!--/*/ </th:block> /*/-->

TODO: check where these comments are unwrapped in the Thymeleaf process.

Command Line tool which converts Thymeleaf to Thymesheet

Some users may find it easier to write in Thymeleaf style (by adding attributes to HTML), but be able to extract this out to a Thymesheet file.

A tool which can analyse Thymeleaf HTML and extract to CSS would be useful.

Unfortunately the generated CSS file would be ultra-specific but would work.

Support for XML

Support Thymesheet for XML documents.

<?xml-stylesheet type="text/thymesheet" href="style9.tss"?>

Externalise Thymesheet includes

Add a parser which uses an XML look up file which lists Thymesheet file(s) per HTML file.

This will mean that the HTML files require zero modifications.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.