mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Initialize variables later
This commit is contained in:
parent
6b4bb762aa
commit
2d4ec5380e
@ -15,12 +15,13 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
const valueParser = require("postcss-value-parser");
|
||||
|
||||
/**
|
||||
* This plugin extracts content inside url() into css variables.
|
||||
* The extracted css variables are added to the :root section.
|
||||
*/
|
||||
let counter;
|
||||
const urlVariables = new Map();
|
||||
let urlVariables;
|
||||
const idToPrepend = "icon-url";
|
||||
|
||||
function extractUrl(decl) {
|
||||
@ -58,6 +59,7 @@ function addResolvedVariablesToRootSelector(root, { Rule, Declaration }) {
|
||||
* @type {import('postcss').PluginCreator}
|
||||
*/
|
||||
module.exports = (opts = {}) => {
|
||||
urlVariables = new Map();
|
||||
counter = 0;
|
||||
return {
|
||||
postcssPlugin: "postcss-url-to-variable",
|
||||
|
Loading…
Reference in New Issue
Block a user