Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to import customer's LESS variable definition file #52

Closed
vinkaga opened this issue May 12, 2014 · 2 comments
Closed

Make it easier to import customer's LESS variable definition file #52

vinkaga opened this issue May 12, 2014 · 2 comments

Comments

@vinkaga
Copy link
Contributor

vinkaga commented May 12, 2014

At this time, in order to customize look and feel, mobile-angular-ui.less, mobile-angular-ui-desktop.less and variables.less files need to customized.

If there were an import statement at the end of variables.less file as follows

@import "customer.less"

along with an empty customer.less file (in src/less directory), a customer could simply modify that file (through gulp/grunt) and get a customized CSS.

@mcasimir
Copy link
Owner

I think the right way would be to install mobile-angular-ui via bower and then setup a custom gruntfile with a less task configured like this:

    less: {
      dist: {
        options: {
          paths: ["mysrc", "bower_components"]
        },
        files: {
          "style.css": "mysrc/style.less"
        }
      }
    }

Then in style.less you can import bower_components/mobile-angular-ui/src/less/mobile-angular-ui.less and customize any variable overriding it.

As far as I know less variables have no scope. They always affects the whole style. Overriding a variable will rewrite it's value wherever it's used.

@import 'mobile-angular-ui/src/less/mobile-angular-ui.less';

// Overrides
@app-bg: green;
@sidebar-width: 500px;

// ...

@vinkaga
Copy link
Contributor Author

vinkaga commented May 15, 2014

You are right, the variables declared at the end DO override any previous declarations even in the classes defined before the redeclaration. My understanding was not correct.
See:
less/less.js#297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants