Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 7449)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 7450)
@@ -35,4 +35,5 @@
 import javax.swing.JFileChooser;
 import javax.swing.JLabel;
+import javax.swing.JMenu;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
@@ -66,4 +67,5 @@
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener;
+import org.openstreetmap.josm.gui.mappaint.StyleSetting;
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
@@ -667,4 +669,24 @@
             add(reloadAction);
             add(new SaveAsAction());
+
+            JMenu setMenu = new JMenu(tr("Style settings"));
+            setMenu.setIcon(ImageProvider.overlay(ImageProvider.get("preference"),
+                ImageProvider.get("dialogs/mappaint/pencil.png"),
+                ImageProvider.OverlayPosition.SOUTHEAST));
+            add(setMenu);
+
+            int sel = tblStyles.getSelectionModel().getLeadSelectionIndex();
+            StyleSource style = null;
+            if (sel >= 0 && sel < model.getRowCount()) {
+                style = model.getRow(sel);
+            }
+            if (style == null || style.settings.isEmpty()) {
+                setMenu.setEnabled(false);
+            } else {
+                for (StyleSetting s : style.settings) {
+                    s.addMenuEntry(setMenu);
+                }
+            }
+
             addSeparator();
             add(new InfoAction());
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java	(revision 7450)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java	(revision 7450)
@@ -0,0 +1,97 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.mappaint;
+
+import java.awt.event.ActionEvent;
+import java.util.Arrays;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JMenu;
+import org.openstreetmap.josm.Main;
+
+/**
+ * Setting to customize a MapPaint style.
+ * 
+ * Can be changed by the user in the right click menu of the mappaint style 
+ * dialog.
+ * 
+ * Defined in the MapCSS style, e.g.
+ * <pre>
+ * setting::highway_casing {
+ *   type: boolean;
+ *   label: tr("Draw highway casing");
+ *   default: true;
+ * }
+ * 
+ * way[highway][setting("highway_casing")] {
+ *   casing-width: 2;
+ *   casing-color: white;
+ * }
+ * </pre>
+ */
+public interface StyleSetting {
+
+    void addMenuEntry(JMenu menu);
+    
+    Object getValue();
+    
+    /**
+     * A style setting for boolean value (yes / no).
+     */
+    public static class BooleanStyleSetting implements StyleSetting {
+        public final StyleSource parentStyle;
+        public final String prefKey;
+        public final String label;
+        public final boolean def;
+
+        public BooleanStyleSetting(StyleSource parentStyle, String prefKey, String label, boolean def) {
+            this.parentStyle = parentStyle;
+            this.prefKey = prefKey;
+            this.label = label;
+            this.def = def;
+        }
+
+        @Override
+        public void addMenuEntry(JMenu menu) {
+            final JCheckBoxMenuItem item = new JCheckBoxMenuItem();
+            Action a = new AbstractAction(label) {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    boolean b = item.isSelected();
+                    if (b == def) {
+                        Main.pref.put(prefKey, null);
+                    } else {
+                        Main.pref.put(prefKey, b);
+                    }
+                    Main.worker.submit(new MapPaintStyles.MapPaintStyleLoader(Arrays.asList(parentStyle)));
+                }
+            };
+            item.setAction(a);
+            item.setSelected((boolean) getValue());
+            menu.add(item);
+        }
+        
+        public static BooleanStyleSetting create(Cascade c, StyleSource parentStyle, String key) {
+            String label = c.get("label", null, String.class);
+            if (label == null) {
+                Main.warn("property 'label' required for boolean style setting");
+                return null;
+            }
+            Boolean def = c.get("default", null, Boolean.class);
+            if (def == null) {
+                Main.warn("property 'default' required for boolean style setting");
+                return null;
+            }
+            String prefKey = parentStyle.url + ":boolean:" + key; 
+            return new BooleanStyleSetting(parentStyle, prefKey, label, def);
+        }
+
+        @Override
+        public Object getValue() {
+            String val = Main.pref.get(prefKey, null);
+            if (val == null) return def;
+            return Boolean.parseBoolean(val);
+        }
+        
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java	(revision 7449)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java	(revision 7450)
@@ -11,5 +11,7 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.swing.ImageIcon;
@@ -41,4 +43,13 @@
 
     public String icon;
+
+    /**
+     * List of settings for user customization.
+     */
+    public final List<StyleSetting> settings = new ArrayList<>();
+    /**
+     * Values of the settings for efficient lookup.
+     */
+    public Map<String, Object> settingValues = new HashMap<>();
 
     public StyleSource(String url, String name, String title) {
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 7449)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java	(revision 7450)
@@ -18,5 +18,4 @@
 import java.util.Collections;
 import java.util.List;
-import java.util.Objects;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -645,9 +644,19 @@
         /**
          * Get the number of tags for the current primitive.
-         * @param env
+         * @param env the environment
          * @return number of tags
          */
         public static int number_of_tags(Environment env) {
             return env.osm.getNumKeys();
+        }
+        
+        /**
+         * Get value of a setting.
+         * @param env the environment
+         * @param key setting key (given as layer identifier, e.g. setting::mykey {...})
+         * @return the value of the setting (calculated when the style is loaded)
+         */
+        public static Object setting(Environment env, String key) {
+            return env.source.settingValues.get(key);
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 7449)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 7450)
@@ -35,4 +35,6 @@
 import org.openstreetmap.josm.gui.mappaint.MultiCascade;
 import org.openstreetmap.josm.gui.mappaint.Range;
+import org.openstreetmap.josm.gui.mappaint.StyleSetting;
+import org.openstreetmap.josm.gui.mappaint.StyleSetting.BooleanStyleSetting;
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.SimpleKeyValueCondition;
@@ -70,5 +72,5 @@
     private String css = null;
     private ZipFile zipFile;
-
+    
     /**
      * This lock prevents concurrent execution of {@link MapCSSRuleIndex#clear() } /
@@ -224,4 +226,5 @@
                     loadMeta();
                     loadCanvas();
+                    loadSettings();
                 } finally {
                     closeSourceInputStream(in);
@@ -276,4 +279,5 @@
                         break;
                     case "meta":
+                    case "setting":
                         break;
                     default:
@@ -352,4 +356,46 @@
         }
     }
+    
+    private void loadSettings() {
+        settings.clear();
+        settingValues.clear();
+        MultiCascade mc = new MultiCascade();
+        Node n = new Node();
+        String code = LanguageInfo.getJOSMLocaleCode();
+        n.put("lang", code);
+        // create a fake environment to read the meta data block
+        Environment env = new Environment(n, mc, "default", this);
+
+        for (MapCSSRule r : rules) {
+            if ((r.selector instanceof GeneralSelector)) {
+                GeneralSelector gs = (GeneralSelector) r.selector;
+                if (gs.getBase().equals("setting")) {
+                    if (!gs.matchesConditions(env)) {
+                        continue;
+                    }
+                    env.layer = gs.getSubpart();
+                    r.execute(env);
+                }
+            }
+        }
+        for (Entry<String, Cascade> e : mc.getLayers()) {
+            if ("default".equals(e.getKey())) {
+                Main.warn("setting requires layer identifier e.g. 'setting::my_setting {...}'");
+                continue;
+            }
+            Cascade c = e.getValue();
+            String type = c.get("type", null, String.class);
+            StyleSetting set = null;
+            if ("boolean".equals(type)) {
+                set = BooleanStyleSetting.create(c, this, e.getKey());
+            } else {
+                Main.warn("Unkown setting type: "+type);
+            }
+            if (set != null) {
+                settings.add(set);
+                settingValues.put(e.getKey(), set.getValue());
+            }
+        }
+    }
 
     private Cascade constructSpecial(String type) {
