Yes, writing a good question is hard.
For a self-answered question, your best bet is to show an example of something reasonable that someone might try if they didn't already know the answer. If your problem generates a specific error from the compiler/interpreter, the inclusion of that error will likely be the best way to help future users find your question/answer.
I'm trying to Foo the Bar. The usual way to do that is like this [insert code here]. That doesn't work for me because I am also doing Y and I get this error [insert error message here].
Goofus
https://stackoverflow.com/questions/11193029/sass-each-loops-in-scss (deleted, 10k+ rep)
I had a lot of repeating code in my css and was looking for a better way to organize it. Where to start? I installed Sass and setup my scss file. I had some button classes like blue, green, red using image sprite. Basically all the code was the same but color and positions.
The question is all kinds of unclear. The author's primary concern here is that they're repeating a lot of code. When you search for "sass repeating", there are a lot of results showing all sorts of things they could try to avoid repetition, but the OP doesn't appear to have tried any of them.
What's worse is that the OP didn't even provide anything as a starting point. The OP may have had the most efficient way to write their code, but
we'll never know that until they leave a comment on the "obvious" answer that will end up getting posted saying "I already tried that".
The provided answer is a "Tada! Here's you're fully fleshed out solution!"
Gallant
Modifying the middle of a selector in Sass (adding/removing classes, etc.)
I have the following SCSS for styling links in my menu:
[...]
Which generates the following (correct) CSS:
[...]
I could rewrite my JavaScript to append the class to the nav element
instead, and use selector-append() in Sass to append the class. But
that seems to do the appending in the wrong order (and if the
arguments are reversed, the class is appended to the last element!):
[...]
Output (incorrect!):
[...]
Is there a way the SCSS can be rewritten so that the class can be
correctly appended without having to duplicate selectors (similar to
the selector-append() method)?
This is a self-answered question I wrote to use as a dupe target for similarly asked questions. I started writing the answer in response to a question written by someone else, but the OP got angry and deleted their question. It seemed like a waste to just throw it away. The phrasing isn't great here (I spent more time proof-reading the answer), but it shows a clear problem along with an example of something that anyone who has done any research at all might have tried (along with information about errors).