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
Say that I have the function foo and the following sass
h1::before {
content: foo()
}
What might I want foo to return? I either want what libsass considers to be an unquoted string, e.g. open-quote, or a quoted string, e.g. 'foo'.
Similarly, if a function takes a string as a parameter, it should be able to distinguish between foo(foo) and foo('foo').
Mirroring how libsass works (where quoted is a boolean field of Sass_String), I'm thinking of adding a parameter to the SassString data constructor like so
I'm trying to remember why I decided to ignore the quoted/unquoted distinction, because I do remember that I wasn't sure what to do about it. My only guess is that I haven't seen any valid usage for unquoted strings, especially at hsass level. I still don't get what the difference is, but I don't do front-end dev much these days, so could you point me to some explanation or explain me what is the benefit of using unquoted strings over quoted ones?
mean different things (the first places open quotes before headings, the second literally prefixes headings with the string 'open-quote'). That was my motivation in creating this issue.
However, I misunderstood how libsass actually works. I've tested it now — the boring details are here. This behaviour might be familiar to you, but to summarise, a function taking a string can only determine if it is quoted by inspecting the quoted field. But when returning a string, the quoted field seems not to matter, and libsass will render the string exactly according to its value (so sass_make_qstring("open-quote") is rendered without quotes). Confusing, unless I'm missing something!
So, for the user of hsass, you can effectively produce quoted and unquoted strings, but you can't tell if a string that you're consuming is quoted or not. I don't actually have a use case for determining if a function's argument is quoted or not, so I don't mind if you consider this behaviour acceptable and close the issue.
It would still be possible to make this more consistant on the hsass/hlibsass side of things (I'd be tempted to define data SassValue = SassString String | SassKeyword String | ... since I think string vs. keyword is more clear than quoted string vs. unquoted string) but it would mean less closely mirroring the way libsass works. I don't know if that would be an improvement.
Say that I have the function
foo
and the following sassWhat might I want
foo
to return? I either want what libsass considers to be an unquoted string, e.g.open-quote
, or a quoted string, e.g.'foo'
.Similarly, if a function takes a string as a parameter, it should be able to distinguish between
foo(foo)
andfoo('foo')
.Mirroring how libsass works (where
quoted
is a boolean field ofSass_String
), I'm thinking of adding a parameter to theSassString
data constructor like soand adding support for this in hlibsass.
The text was updated successfully, but these errors were encountered: