generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add viewport-(width/height) less functions
- Loading branch information
Showing
4 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = { | ||
install(less, pluginManager, functions) { | ||
functions.add('vw', function (percentage) { | ||
return new less.tree.Call('calc', [ | ||
new less.tree.Operation( | ||
'*', | ||
[ | ||
new less.tree.Call('var', [ | ||
new less.tree.UnicodeDescriptor('--vw'), | ||
new less.tree.Dimension( | ||
1, | ||
new less.tree.Unit(['vw'], null, 'vw'), | ||
), | ||
]), | ||
percentage, | ||
], | ||
true, | ||
), | ||
]); | ||
}); | ||
|
||
functions.add('vh', function (percentage) { | ||
return new less.tree.Call('calc', [ | ||
new less.tree.Operation( | ||
'*', | ||
[ | ||
new less.tree.Call('var', [ | ||
new less.tree.UnicodeDescriptor('--vh'), | ||
new less.tree.Dimension( | ||
1, | ||
new less.tree.Unit(['vh'], null, 'vh'), | ||
), | ||
]), | ||
percentage, | ||
], | ||
true, | ||
), | ||
]); | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters