You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that you list the css package here in the README. About a year ago, I took over maintainership, but it didn't take me long to realize that it needed a complete overhaul:
While some type classes exist to support keyword reuse (even if not implemented consistently), they don't solve conflicts between property names and keyword values. For example, left is both a value (e.g. float: left) and a property (e.g. left: 100px). Without fundamental design changes, the only solution is to awkwardly name the functions that represent them and/or require them to be imported (qualified) from separate modules.
garyb, a previous maintainer and prominent member of the PureScript Core Team, alluded to problems as far back as 2018. Another core team member acknowledged to me privately that the css package is "quite old" and "not in the best shape". The earliest committers are long gone. And I was given sole maintainership after a single decent PR. I think it's safe to say (although I am sorry to say it) that no one feels much of a sense of ownership over this codebase, and I doubt that anyone familiar believes it's particularly good.
Hopefully, then, you'll understand why I essentially gave up and created a new CSS library called Tecton. I'm not claiming perfection, but I certainly have addressed all of the issues described above and then some. For each feature I've implemented, I've carefully referenced the relevant W3C specifications; and I've heavily leveraged type classes to achieve a flexible API that actually somewhat resembles the underlying CSS. For good measure, I've implemented over 1,700 tests based on real CSS examples from the W3C and MDN and adapted a sizable real-world example to help ensure adequate CSS coverage.
I do regret that I had to create a new library because many in the PureScript community are unaware of it and newcomers will almost certainly stumble upon the css package first. However, the alternative was to break compatibility in a big way, which I'm not sure everyone would be willing to accept. (On the other hand, this creates a bit of a "namespacing" issue and potential fragmentation in the community, so perhaps there is some possibility of Tecton replacing the css package in the future.)
Anyway, thanks for reading. Please do check out Tecton and, if you feel it is appropriate, consider replacing the css listing in the README.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I noticed that you list the css package here in the README. About a year ago, I took over maintainership, but it didn't take me long to realize that it needed a complete overhaul:
The library is simply too incomplete for any serious project. Examples: virtually no pseudo-selectors, virtually no support for media queries, no grid properties, and so on.
Countless issues with namespacing and keyword reuse. For example, I might have to write a declaration like
overflow overflowInherit
because theCSS.Common.inherit
value is incompatible with theoverflow
function/property. Similarly, I would have tofloat floatLeft
ortextAlign leftTextAlign
.While some type classes exist to support keyword reuse (even if not implemented consistently), they don't solve conflicts between property names and keyword values. For example,
left
is both a value (e.g.float: left
) and a property (e.g.left: 100px
). Without fundamental design changes, the only solution is to awkwardly name the functions that represent them and/or require them to be imported (qualified) from separate modules.Not all that much type safety. For example,
backgroundImage []
would compile just fine but result in the invalid declarationbackground-image: ;
. Similarly, theboxShadow
function accepts anySize a
values including percentages, but actually thebox-shadow
property doesn't support percentages.Not much flexibility. For example,
boxShadow
only supports a single shadow, while the corresponding CSS property allows multiple shadows ornone
. Less critically, but just as annoyingly, properties likepadding
require values for all four sides, instead of supporting their very commonly used shorthand syntax.Producing invalid output actually makes static typing counterproductive.
garyb, a previous maintainer and prominent member of the PureScript Core Team, alluded to problems as far back as 2018. Another core team member acknowledged to me privately that the css package is "quite old" and "not in the best shape". The earliest committers are long gone. And I was given sole maintainership after a single decent PR. I think it's safe to say (although I am sorry to say it) that no one feels much of a sense of ownership over this codebase, and I doubt that anyone familiar believes it's particularly good.
Hopefully, then, you'll understand why I essentially gave up and created a new CSS library called Tecton. I'm not claiming perfection, but I certainly have addressed all of the issues described above and then some. For each feature I've implemented, I've carefully referenced the relevant W3C specifications; and I've heavily leveraged type classes to achieve a flexible API that actually somewhat resembles the underlying CSS. For good measure, I've implemented over 1,700 tests based on real CSS examples from the W3C and MDN and adapted a sizable real-world example to help ensure adequate CSS coverage.
I do regret that I had to create a new library because many in the PureScript community are unaware of it and newcomers will almost certainly stumble upon the css package first. However, the alternative was to break compatibility in a big way, which I'm not sure everyone would be willing to accept. (On the other hand, this creates a bit of a "namespacing" issue and potential fragmentation in the community, so perhaps there is some possibility of Tecton replacing the css package in the future.)
Anyway, thanks for reading. Please do check out Tecton and, if you feel it is appropriate, consider replacing the css listing in the README.
The text was updated successfully, but these errors were encountered: