What Sass means by "@function rules may not contain style rules."
When writing a Sass function, you may run into an error message that may be confusing:
@function rules may not contain style rules.
What Sass is trying to tell you is that a line in your Sass function is computing a result that is neither assigned to a variable nor returned.
Keep in mind that all functions in Sass return something, Sass does not mutate objects.
Related cards:
What collapsing margins are, how they work and when margins do not collapse
Imagine you have 2 HTML boxes. The first one has a margin-bottom
of let's say 30px
and the second one a margin-top
of 20px
. After rules of collapsing margins have been applied we ha...
What we know about PDFKit
What PDFKit is
- PDFKit converts a web page to a PDF document. It uses a Webkit engine under the hood.
- For you as a web developer this means you can keep using the technology you are familar wit...
Ruby: A small summary of what return, break and next means for blocks
Summary
- Use
return
to return from a method.return
accepts a value that will be the return value of the method call. - Use
break
to quit from a block and from the method that yielded to the block.break
accepts a value that suppl...
Sass: Don't put CSS rules into partials that you import multiple times
TLDR: When you put CSS rules into a partial and import that partial multiple times, the CSS rules will be duplicated in the compiled CSS.
Here is a Sass partial called _fonts.sass
...
MySQL: How to create columns like "bigint" or "longtext" in Rails migrations, and what :limit means for column migrations
Rails understands a :limit
options when you create columns in a migration. Its meaning depends on the column type, and sometimes the supplied value.
[The documentation](http://apidock.com/rails/ActiveRecord/ConnectionAdapters/TableDefinition/co...
what to do if nova's iptables rules are missing
After restarting an OpenStack host you may encouter problems with missing iptables rules (we're on an quite old release of OpenStack currently. Maybe this is fixed in newer releases). The nova chains appear in the iptables -L
output but they're ...
Sass function to set a color to an absolute hue
The adjust-hue
function of Sass allows you to change a color's hue, but only relative to its current hue.
adjust-hue(#ffff00, 120)
// => #00ffff...
SASS: Reusing styles from other files
SASS has an @extend
keyword to inherit styles.
.alert
color: red
&.-framed
border: 1px solid red
padding: 5px
&.-homepage
@extend .-framed
border-width...
PSA: Umlauts are not always what they seem to be
When you have a string containing umlauts which don't behave as expected (are not matched with a regexp, can't be found with an SQL query, do not print correctly on LaTeX documents, etc), you may be encountering umlauts which are not actually umla...