Bulk Prefixing in Stylus

Created on 2023-01-24T10:05:52-06:00

Return to the Index

This card can also be read via Gemini.

Just wrap the import statement in a selector. Imported code will have the prefix inserted on every rule created by the import.

Useful when dealing with component systems like Foundry VTT where different modules are expected to protect their styles this way.

futz {
@import '_text-align'
}

Becomes

futz .tl {
  text-align: left;
}
futz .tr {
  text-align: right;
}
futz .tc {
  text-align: center;
}
futz .tj {
  text-align: justify;
}