package tm-grammars

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file tm_grammar_qss.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
let lang_id = "qss"
let json = {json|{
  "displayName": "Qt Style Sheets",
  "name": "qss",
  "patterns": [
    {
      "include": "#comment-block"
    },
    {
      "include": "#rule-list"
    },
    {
      "include": "#selector"
    }
  ],
  "repository": {
    "color": {
      "patterns": [
        {
          "begin": "\\b(rgba??|hsva??|hsla??)\\s*\\(",
          "beginCaptures": {
            "1": {
              "name": "entity.name.function.qss"
            }
          },
          "description": "Color Type",
          "end": "\\)",
          "patterns": [
            {
              "include": "#comment-block"
            },
            {
              "include": "#number"
            }
          ]
        },
        {
          "match": "\\b(white|black|red|darkred|green|darkgreen|blue|darkblue|cyan|darkcyan|magenta|darkmagenta|yellow|darkyellow|gray|darkgray|lightgray|transparent|color0|color1)\\b",
          "name": "support.constant.property-value.named-color.qss"
        },
        {
          "match": "#(\\h{3}|\\h{6}|\\h{8})\\b",
          "name": "support.constant.property-value.color.qss"
        }
      ]
    },
    "comment-block": {
      "patterns": [
        {
          "begin": "/\\*",
          "end": "\\*/",
          "name": "comment.block.qss"
        }
      ]
    },
    "icon-properties": {
      "patterns": [
        {
          "match": "\\b((?:backward|cd|computer|desktop|dialog-apply|dialog-cancel|dialog-close|dialog-discard|dialog-help|dialog-no|dialog-ok|dialog-open|dialog-reset|dialog-save|dialog-yes|directory-closed|directory|directory-link|directory-open|dockwidget-close|downarrow|dvd|file|file-link|filedialog-contentsview|filedialog-detailedview|filedialog-end|filedialog-infoview|filedialog-listview|filedialog-new-directory|filedialog-parent-directory|filedialog-start|floppy|forward|harddisk|home|leftarrow|messagebox-critical|messagebox-information|messagebox-question|messagebox-warning|network|rightarrow|titlebar-contexthelp|titlebar-maximize|titlebar-menu|titlebar-minimize|titlebar-normal|titlebar-close|titlebar-shade|titlebar-unshade|trash|uparrow)-icon)\\b",
          "name": "support.type.property-name.qss"
        }
      ]
    },
    "id-selector": {
      "patterns": [
        {
          "captures": {
            "1": {
              "name": "punctuation.definition.entity.qss"
            },
            "2": {
              "name": "entity.name.tag.qss"
            }
          },
          "match": "(#)([A-Za-z][-0-9A-Z_a-z]*)"
        }
      ]
    },
    "number": {
      "patterns": [
        {
          "description": "floating number",
          "match": "\\b(\\d+)?\\.(\\d+)\\b",
          "name": "constant.numeric.qss"
        },
        {
          "description": "percentage",
          "match": "\\b(\\d+)%",
          "name": "constant.numeric.qss"
        },
        {
          "description": "length",
          "match": "\\b(\\d+)(px|pt|em|ex)?\\b",
          "name": "constant.numeric.qss"
        },
        {
          "description": "integer",
          "match": "\\b(\\d+)\\b",
          "name": "constant.numeric.qss"
        }
      ]
    },
    "properties": {
      "patterns": [
        {
          "include": "#property-values"
        },
        {
          "match": "\\b(paint-alternating-row-colors-for-empty-area|dialogbuttonbox-buttons-have-icons|titlebar-show-tooltips-on-buttons|messagebox-text-interaction-flags|lineedit-password-mask-delay|outline-bottom-right-radius|lineedit-password-character|selection-background-color|outline-bottom-left-radius|border-bottom-right-radius|alternate-background-color|widget-animation-duration|border-bottom-left-radius|show-decoration-selected|outline-top-right-radius|outline-top-left-radius|border-top-right-radius|border-top-left-radius|background-attachment|subcontrol-position|border-bottom-width|border-bottom-style|border-bottom-color|background-position|border-right-width|border-right-style|border-right-color|subcontrol-origin|border-left-width|border-left-style|border-left-color|background-origin|background-repeat|border-top-width|border-top-style|border-top-color|background-image|background-color|text-decoration|selection-color|background-clip|padding-bottom|outline-radius|outline-offset|image-position|gridline-color|padding-right|outline-style|outline-color|margin-bottom|button-layout|border-radius|border-bottom|padding-left|margin-right|border-width|border-style|border-image|border-color|border-right|padding-top|margin-left|font-weight|font-family|border-left|text-align|min-height|max-height|margin-top|font-style|border-top|background|min-width|max-width|icon-size|font-size|position|spacing|padding|outline|opacity|margin|height|bottom|border|width|right|image|color|left|font|top)\\b",
          "name": "support.type.property-name.qss"
        },
        {
          "include": "#icon-properties"
        }
      ]
    },
    "property-selector": {
      "patterns": [
        {
          "begin": "\\[",
          "end": "]",
          "patterns": [
            {
              "include": "#comment-block"
            },
            {
              "include": "#string"
            },
            {
              "match": "\\b[A-Z_a-z]\\w*\\b",
              "name": "variable.parameter.qml"
            }
          ]
        }
      ]
    },
    "property-values": {
      "patterns": [
        {
          "begin": ":",
          "end": ";|(?=})",
          "patterns": [
            {
              "include": "#comment-block"
            },
            {
              "include": "#color"
            },
            {
              "begin": "\\b(q(?:linear|radial|conical)gradient)\\s*\\(",
              "beginCaptures": {
                "1": {
                  "name": "entity.name.function.qss"
                }
              },
              "description": "Gradient Type",
              "end": "\\)",
              "patterns": [
                {
                  "include": "#comment-block"
                },
                {
                  "match": "\\b(x1|y1|x2|y2|stop|angle|radius|cx|cy|fx|fy)\\b",
                  "name": "variable.parameter.qss"
                },
                {
                  "include": "#color"
                },
                {
                  "include": "#number"
                }
              ]
            },
            {
              "begin": "\\b(url)\\s*\\(",
              "beginCaptures": {
                "1": {
                  "name": "entity.name.function.qss"
                }
              },
              "contentName": "string.unquoted.qss",
              "description": "URL Type",
              "end": "\\)"
            },
            {
              "match": "\\bpalette\\s*(?=\\()\\b",
              "name": "entity.name.function.qss"
            },
            {
              "match": "\\b(highlighted-text|alternate-base|line-through|link-visited|dot-dot-dash|window-text|button-text|bright-text|underline|no-repeat|highlight|overline|absolute|relative|repeat-y|repeat-x|midlight|selected|disabled|dot-dash|content|padding|oblique|stretch|repeat|window|shadow|button|border|margin|active|italic|normal|outset|groove|double|dotted|dashed|repeat|scroll|center|bottom|light|solid|ridge|inset|fixed|right|text|link|dark|base|bold|none|left|mid|off|top|on)\\b",
              "name": "support.constant.property-value.qss"
            },
            {
              "match": "\\b(true|false)\\b",
              "name": "constant.language.boolean.qss"
            },
            {
              "include": "#string"
            },
            {
              "include": "#number"
            }
          ]
        }
      ]
    },
    "pseudo-states": {
      "patterns": [
        {
          "match": "\\b(active|adjoins-item|alternate|bottom|checked|closable|closed|default|disabled|editable|edit-focus|enabled|exclusive|first|flat|floatable|focus|has-children|has-siblings|horizontal|hover|indeterminate|last|left|maximized|middle|minimized|movable|no-frame|non-exclusive|off|on|only-one|open|next-selected|pressed|previous-selected|read-only|right|selected|top|unchecked|vertical|window)\\b",
          "name": "keyword.control.qss"
        }
      ]
    },
    "rule-list": {
      "patterns": [
        {
          "begin": "\\{",
          "end": "}",
          "patterns": [
            {
              "include": "#comment-block"
            },
            {
              "include": "#properties"
            },
            {
              "include": "#icon-properties"
            }
          ]
        }
      ]
    },
    "selector": {
      "patterns": [
        {
          "include": "#stylable-widgets"
        },
        {
          "include": "#sub-controls"
        },
        {
          "include": "#pseudo-states"
        },
        {
          "include": "#property-selector"
        },
        {
          "include": "#id-selector"
        }
      ]
    },
    "string": {
      "description": "String literal with double or signle quote.",
      "patterns": [
        {
          "begin": "'",
          "end": "'",
          "name": "string.quoted.single.qml"
        },
        {
          "begin": "\"",
          "end": "\"",
          "name": "string.quoted.double.qml"
        }
      ]
    },
    "stylable-widgets": {
      "patterns": [
        {
          "match": "\\b(Q(?:AbstractScrollArea|AbstractItemView|CheckBox|ColumnView|ComboBox|DateEdit|DateTimeEdit|Dialog|DialogButtonBox|DockWidget|DoubleSpinBox|Frame|GroupBox|HeaderView|Label|LineEdit|ListView|ListWidget|MainWindow|Menu|MenuBar|MessageBox|ProgressBar|PlainTextEdit|PushButton|RadioButton|ScrollBar|SizeGrip|Slider|SpinBox|Splitter|StatusBar|TabBar|TabWidget|TableView|TableWidget|TextEdit|TimeEdit|ToolBar|ToolButton|ToolBox|ToolTip|TreeView|TreeWidget|Widget))\\b",
          "name": "entity.name.type.qss"
        }
      ]
    },
    "sub-controls": {
      "patterns": [
        {
          "match": "\\b(add-line|add-page|branch|chunk|close-button|corner|down-arrow|down-button|drop-down|float-button|groove|indicator|handle|icon|item|left-arrow|left-corner|menu-arrow|menu-button|menu-indicator|right-arrow|pane|right-corner|scroller|section|separator|sub-line|sub-page|tab|tab-bar|tear|tearoff|text|title|up-arrow|up-button)\\b",
          "name": "entity.other.inherited-class.qss"
        }
      ]
    }
  },
  "scopeName": "source.qss"
}|json}