Comments (9)
i never used it , +1 from me :)
from scalacss.
Thanks @chandu0101 - the more feedback and voices heard the better.
It's sorta sucks because it actually does address the requirements it was intended for - the problem is it's just a bit fiddly/annoying/alien to use. Might be better to replace it with something based on plain Scala case classes or something.
from scalacss.
My motivation for using it to be able to skin a component (that represents more than one element).
For example, I have a SearchBar
that has a structure something like this:
div(wrapperStyle,
span(/*magnifying glass icon*/, iconStyle),
input(`type` := text, inputStyle)
)
I'd like my component to provide a default skin (defined styles for wrapper, icon, and input) but also allow the caller to pass in a custom style set via Props. styleC doesn't really serve this purpose or at least I don't see how it could. What would the type of my style be in Props, just StyleC
? It would need to be parametrized so the caller knew they needed to pass in three styles.
from scalacss.
For me styleC is the most complicated and unclear feature - because of the terrible usage syntax. I understand that this conception may be usefull sometimes, but it creates a lot of syntax noise in the code.
Also, in the most cases I need unsafeChild
. I just want to have some css hierarchy without restrictions. In standalone styles I can use &
to create nested styles, and this &
symbol creates less amount of syntax noise than unsafeChild
.
So, my proposal - remove styleC and rename unsafeChild
to &
. If it will help to remove such huge lib as shapeless it would be really cool!
from scalacss.
I started with it and ended up ripping it out and prefixing groups of styles. Dropping the shapeless dependency is also a plus for code size.
from scalacss.
Yeah same. Will definitely do this (and other work) but it will have to
wait around 2 months unfortunately.
On 25 November 2015 at 13:10, Joseph Price [email protected] wrote:
I started with it and ended up ripping it out and prefixing groups of
styles. Dropping the shapeless dependency is also a plus for code size.—
Reply to this email directly or view it on GitHub
#48 (comment).
from scalacss.
The StyleC
experiment was meant to address the following:
- A logical/composite style (eg a style for an entire widget) can have multiple CSS styles that need to be applied.
- Adding a new sub-style to a composite style should result in a compilation error in all places that you don't update to use the new sub-style.
- Styles all have the same type. Adding/removing/reordering sub-styles shouldn't result in silent undetectable errors where the sub-style ends up being applied to the wrong part of HTML.
StyleC
does actually solve those things. It's just a horrible pain in the ass to use. Anyway, a replacement will need to at least consider the above goals with the additional goal that it not be horrible to use.
from scalacss.
Screw it - I'll just remove it without replacement in 0.4.0. No one likes it, I don't think anyone uses it (except me and only in one place). I'd normally deprecate it and offer a replacement but I think this time it'll be better just to get Shapeless off the classpath.
from scalacss.
Closed via #48. New ticket #71 to find a replacement.
from scalacss.
Related Issues (20)
- could not find implicit value for evidence parameter of type scalacss.internal.StyleLookup HOT 4
- `gap` and `row-gap` attrs aren't supported HOT 3
- gridArea(String)
- Missing: alignSelf.start HOT 1
- Missing: justifySelf HOT 1
- Missing: placeSelf HOT 1
- Scala 2.13 HOT 9
- Update Docs for 0.6 HOT 4
- Add ClassName.toSel HOT 1
- Scala.js 1.x support HOT 1
- content attr should quote its input
- Media query is sorted wrong HOT 3
- How to generate custom CSS declaration?
- Support for generating a StyleSheet targeting multiple `Platform`s worth of browser prefixes
- Browser prefixes are added based on "all-time" as opposed to configurable browser versions
- Browser Prefix Transforms are Over-Eager
- 'media' functionality not recognisable in scala 2.13 HOT 1
- Class name generation and ad-block
- Update docs for v 1.0.0 and Scala 3 HOT 1
- Why do the maven repos have scala 3 version of "core" but not "ext-scalatags"?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalacss.