{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2606","labels_url":"https://api.github.com/repos/less/less.js/issues/2606/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2606/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2606/events","html_url":"https://github.com/less/less.js/issues/2606","id":87111508,"number":2606,"title":"Load less variables from JSON","user":{"login":"donnes","id":9506146,"avatar_url":"https://avatars.githubusercontent.com/u/9506146?v=3","gravatar_id":"","url":"https://api.github.com/users/donnes","html_url":"https://github.com/donnes","followers_url":"https://api.github.com/users/donnes/followers","following_url":"https://api.github.com/users/donnes/following{/other_user}","gists_url":"https://api.github.com/users/donnes/gists{/gist_id}","starred_url":"https://api.github.com/users/donnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donnes/subscriptions","organizations_url":"https://api.github.com/users/donnes/orgs","repos_url":"https://api.github.com/users/donnes/repos","events_url":"https://api.github.com/users/donnes/events{/privacy}","received_events_url":"https://api.github.com/users/donnes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/less/less.js/labels/NeedsInfo","name":"NeedsInfo","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-10T21:21:14Z","updated_at":"2015-06-15T16:22:20Z","closed_at":null,"body":"I'm developing a \"module builder\", when I will create \"modules\" (header, footer, forms, etc) for my websites.\r\nSo I will load all \"module\" dependencies from a JSON file.\r\n\r\n### Example:\r\n##### `module.json` - Read module dependencies.\r\n```\r\n{\r\n\t\"variables\": {\r\n\t\t\"less\" : {\r\n\t\t\t\"header_blue_bg\": \"@pallet_01_color_01\",\r\n\t\t\t\"header_blue_color\": \"@pallet_02_color_01\",\r\n\t\t\t\"header_blue_link\": \"@pallet_03_color_01\"\r\n\t\t}\r\n\t},\r\n\t\"files\": {\r\n\t\t\"js\": [\r\n\t\t],\r\n\t\t\"less\": [\r\n\t\t\t\"less/header_blue.less\"\r\n\t\t]\r\n\t}\r\n}\r\n```\r\n\r\n> `@pallet_XX_color_XX` - Are variables of color picker.\r\n\r\n### Example\r\n##### `header_blue.less`\r\n```\r\n.header {\r\n\tbackground: @header_blue_bg;\r\n\tcolor: @header_blue_color;\r\n\r\n\ta {\r\n\t\tcolor: @header_blue_link;\r\n\t}\r\n}\r\n```\r\n> Well, note that I don't have a `variables.less` and my variables are been loaded from the JSON.\r\nI loaded my variables and I used a `less.modifyVars()` function to change the variables, but it don't work.\r\n\r\nIn console I receive an error that tells me that the variables are undefined.\r\n\r\nWell, is it and sorry for bad english."},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/112126015","html_url":"https://github.com/less/less.js/issues/2606#issuecomment-112126015","issue_url":"https://api.github.com/repos/less/less.js/issues/2606","id":112126015,"user":{"login":"seven-phases-max","id":5304376,"avatar_url":"https://avatars.githubusercontent.com/u/5304376?v=3","gravatar_id":"","url":"https://api.github.com/users/seven-phases-max","html_url":"https://github.com/seven-phases-max","followers_url":"https://api.github.com/users/seven-phases-max/followers","following_url":"https://api.github.com/users/seven-phases-max/following{/other_user}","gists_url":"https://api.github.com/users/seven-phases-max/gists{/gist_id}","starred_url":"https://api.github.com/users/seven-phases-max/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seven-phases-max/subscriptions","organizations_url":"https://api.github.com/users/seven-phases-max/orgs","repos_url":"https://api.github.com/users/seven-phases-max/repos","events_url":"https://api.github.com/users/seven-phases-max/events{/privacy}","received_events_url":"https://api.github.com/users/seven-phases-max/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T16:22:20Z","updated_at":"2015-06-15T16:22:20Z","body":"@donnes I see. But the main point in my question is \"do you import the file where this `@model_default_navbar_bg` is defined in the files you compile\"? Actually, I start to think that the whole problem is not in `modifyVars` at all but in missing imports... "}}