Anyone have experience working with the @extend directive in CSS preprocessors?

I came across a post that advocates decoupling HTML markup from bootstrap classes by using @extend. I don't particularly agree with many of the points the author makes, but the technique is intriguing and might be something that can applied to Tapestry since we support Less. Here is the link to the article.

https://hackernoon.com/the-backendification-of-frontend-development-62f218a773d4

The interesting bit is titled "Dealing with CSS Frameworks" and contains the following example:

%our-warning-button {
   @extend .btn;
   @extend .btn-warning;
}
.empty-shopping-cart-button {
  @extend %our-warning-button;
}

Searching the web a bit I came across another article that gets into this in more detail. The article's title is a bit misleading since it actually advocates the @extend technique and offer somes advice on best practices.

https://webinista.com/updates/dont-use-extend-sass/

David

emailsig On 2/19/2019 6:03 AM, Chris Poulsen wrote:
Hi

I think working on making the framework "core" more css agnostic seems like
a good direction, allowing things to move forward without having to try and
pick (and maintain) the correct bootstrap version (or other css framework
version/flavor). There is a pretty good chance that whatever is selected,
will not fit the requirements of everybody anyway.

It is a while back, but was the tapestry bootstrap integration not
initially handled "externally" by a markup renderer filter (I guess it
removed the tapestry default styling and added the bootstrap equivalent).
Maybe something similar could be used to apply styling (Tapestry-BS3,
Tapestry- BS4 or whatever) to the tapestry components, without having to
dream up new stuff. (Provided that the processing does not become a
significant performance bottle-neck).




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to