Skip to content

Instantly share code, notes, and snippets.

@elrumordelaluz
Last active April 18, 2016 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elrumordelaluz/5ae285dc46da7af1ab88f3fed53118bd to your computer and use it in GitHub Desktop.
Save elrumordelaluz/5ae285dc46da7af1ab88f3fed53118bd to your computer and use it in GitHub Desktop.
Alternatives for @apply proposal
@define --my-theme {
color: var(--main-color, #bada55);
font-size: 1em;
/* ... */
};
.hero {
apply: var(--my-theme);
width: 100vw;
/* ... */
}
@charset <string>;
@import [ <string> | <url> ] [<media-query-list>]?;
@namespace <namespace-prefix>? [ <string> | <uri> ]; /* where <namespace-prefix> = IDENT */
@media <media-query-list> {
<group-rule-body>
}
@supports <supports-condition> {
<group-rule-body>
}
@keyframes <identifier> {
[ [ from | to | <percentage> ] [, from | to | <percentage> ]* block ]*
}
@font-face {
[ font-family: <family-name>; ] ||
[ src: [ <uri> [format(<string>#)]? | <font-face-name> ]#; ] ||
[ unicode-range: <urange>#; ] ||
[ font-variant: <font-variant>; ] ||
[ font-feature-settings: normal | <feature-tag-value>#; ] ||
[ font-stretch: <font-stretch>; ] ||
[ font-weight: <weight>; ] ||
[ font-style: <style>; ]
} /* where <family-name> = <string> | <IDENT>+
<feature-tag-value> = <string> [ <integer> | on | off ]? */
@Kseso
Copy link

Kseso commented Apr 17, 2016

I don´t like your "apply"

apply: var(--my-theme);

Tha´s as if you´ld be using a "custom property", not a "custom at rule.
Maybe better use the @ inside var();

.hero {
  apply: var(@--my-theme);
  width: 100vw;
  /* ... */
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment