Skip to content

Instantly share code, notes, and snippets.

@andrewwakeling
Last active December 30, 2015 00:19
Show Gist options
  • Save andrewwakeling/7748745 to your computer and use it in GitHub Desktop.
Save andrewwakeling/7748745 to your computer and use it in GitHub Desktop.
globalVars causing undesirable caching behaviour with Local Storage.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet/less" type="text/css" href="problem.less">
<script>
less = {
env: 'production'
};
var useGlobalVars = true;
if (useGlobalVars) {
less.globalVars = {
"@primary": "#555"
}
}
</script>
<script src=less-1.5.1.js></script>
</head>
<body>
</body>
</html>
.conditionalbackground (@c: white) when (iscolor(@c)) {
background-color: @c;
}
body {
.conditionalbackground(@primary);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment