mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +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");
|
const valueParser = require("postcss-value-parser");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This plugin extracts content inside url() into css variables.
|
* This plugin extracts content inside url() into css variables.
|
||||||
* The extracted css variables are added to the :root section.
|
* The extracted css variables are added to the :root section.
|
||||||
*/
|
*/
|
||||||
let counter;
|
let counter;
|
||||||
const urlVariables = new Map();
|
let urlVariables;
|
||||||
const idToPrepend = "icon-url";
|
const idToPrepend = "icon-url";
|
||||||
|
|
||||||
function extractUrl(decl) {
|
function extractUrl(decl) {
|
||||||
@ -58,6 +59,7 @@ function addResolvedVariablesToRootSelector(root, { Rule, Declaration }) {
|
|||||||
* @type {import('postcss').PluginCreator}
|
* @type {import('postcss').PluginCreator}
|
||||||
*/
|
*/
|
||||||
module.exports = (opts = {}) => {
|
module.exports = (opts = {}) => {
|
||||||
|
urlVariables = new Map();
|
||||||
counter = 0;
|
counter = 0;
|
||||||
return {
|
return {
|
||||||
postcssPlugin: "postcss-url-to-variable",
|
postcssPlugin: "postcss-url-to-variable",
|
||||||
|
Loading…
Reference in New Issue
Block a user