Skip to content

Commit

Permalink
Use common Single Quotes for Strings (#4939)
Browse files Browse the repository at this point in the history
* Use common Single Quote for Strings

* Update CONTRIBUTING.md
  • Loading branch information
MaikBusch78 committed Apr 2, 2024
1 parent 9fc6ed4 commit 3672c45
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -116,6 +116,27 @@ instead of
}
}
```
* Use the PostgreSQL quoting syntax for attributes (columns) and string-values of selectors.
Use no quotes or double quotes for attributes (columns) and single quotes for string-values.
For Example:

```mss
#layer[entrance = 'yes'] {
marker-width: 6.0;
}
#layer["generator:source" = 'wind'] {
marker-width: 8.0;
}
```
instead of
```mss
#layer[entrance = "yes"] {
marker-width: 6.0;
}
#layer['generator:source' = 'wind'] {
marker-width: 8.0;
}
```

## SQL style guidelines
Because SQL within JSON or YAML will not generally be syntax highlighted, indentation and caps are particularly important.
Expand Down
20 changes: 10 additions & 10 deletions style/buildings.mss
Expand Up @@ -52,29 +52,29 @@
marker-width: 5.0;
marker-height: 5.0;
marker-opacity: 0.0;
["entrance" = "main"] {
["entrance" = 'main'] {
marker-opacity: 1.0;
marker-file: url('symbols/square.svg');
}
}
[zoom >= 19]["entrance" != null] {
["entrance" = "yes"],
["entrance" = "main"],
["entrance" = "home"],
["entrance" = "service"],
["entrance" = "staircase"] {
["entrance" = 'yes'],
["entrance" = 'main'],
["entrance" = 'home'],
["entrance" = 'service'],
["entrance" = 'staircase'] {
marker-opacity: 1.0;
marker-width: 6.0;
marker-height: 6.0;
["entrance" = "service"] {
["entrance" = 'service'] {
marker-file: url('symbols/corners.svg');
}
}
["access" = "yes"],
["access" = "permissive"] {
["access" = 'yes'],
["access" = 'permissive'] {
marker-fill: @entrance-permissive;
}
["access" = "no"] {
["access" = 'no'] {
marker-fill: @entrance-normal;
marker-file: url('symbols/rectdiag.svg');
}
Expand Down
8 changes: 4 additions & 4 deletions style/landcover.mss
Expand Up @@ -816,10 +816,10 @@
//Also landuse = forest, converted in the SQL
[natural = 'wood'][zoom >= 13]::wood {
polygon-pattern-file: url('symbols/leaftype_unknown.svg'); // Lch(55,30,135)
[leaf_type = "broadleaved"] { polygon-pattern-file: url('symbols/leaftype_broadleaved.svg'); }
[leaf_type = "needleleaved"] { polygon-pattern-file: url('symbols/leaftype_needleleaved.svg'); }
[leaf_type = "mixed"] { polygon-pattern-file: url('symbols/leaftype_mixed.svg'); }
[leaf_type = "leafless"] { polygon-pattern-file: url('symbols/leaftype_leafless.svg'); }
[leaf_type = 'broadleaved'] { polygon-pattern-file: url('symbols/leaftype_broadleaved.svg'); }
[leaf_type = 'needleleaved'] { polygon-pattern-file: url('symbols/leaftype_needleleaved.svg'); }
[leaf_type = 'mixed'] { polygon-pattern-file: url('symbols/leaftype_mixed.svg'); }
[leaf_type = 'leafless'] { polygon-pattern-file: url('symbols/leaftype_leafless.svg'); }
polygon-pattern-alignment: global;
opacity: 0.4; // The entire layer has opacity to handle overlapping forests
}
Expand Down

0 comments on commit 3672c45

Please sign in to comment.