Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Does mss support overrides? #425

Open
OnkelTem opened this issue Jan 15, 2016 · 4 comments
Open

Does mss support overrides? #425

OnkelTem opened this issue Jan 15, 2016 · 4 comments
Labels

Comments

@OnkelTem
Copy link

Or rather - why doesn't it support overrides? This is trivial thing. And obvious (see CSS).

@tmcw
Copy link
Contributor

tmcw commented Jan 15, 2016

  • Yes, it does, if our understandings of what an override is are the same
  • I would recommend avoiding writing "trivial / obvious / why doesn't it" in issues, unless you're confident that it's actually something so trivial you could do it.

@OnkelTem
Copy link
Author

Thanks for quick reply.

Under "obvious" I meant: when there's something similar to a thing which you're familiar with, you'd expect it to behave similarly.
So if I have two files:
file1.mss

#roads {
  text-size: 12;
}

file2.mss

#roads {
  text-size: 14;
}

included in this order, then the final text-size becomes 12, not 14.

@tmcw
Copy link
Contributor

tmcw commented Jan 15, 2016

You might want to try those in reverse, earlier rules can win in CartoCSS.

While we'd like CartoCSS to have very similar to CSS, it's important to remember that it isn't CSS: it isn't interpreted by a browser, and does not style elements. None of the precedence, overriding, or interpretation of the language comes 'for free', and the codebase is, in some places, just as complex as a browser - because it's doing the job of a browser.

@OnkelTem
Copy link
Author

You might want to try those in reverse, earlier rules can win in CartoCSS.

That's not redefining, it's more a pre-defining which is not convenient in some respects. For example I can't redefineshield-min-distance property because it requires also defining shield_file, but referencing files in not my style responsibility. (Also I doubt if styles are actually augmented later when encountering the same selector.)

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

No branches or pull requests

3 participants