After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761056 - Improve css highlighting within at-media rule
Improve css highlighting within at-media rule
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-24 18:56 UTC by Tobias Schönberg
Modified: 2016-01-31 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot showing bugs in at-media rule highlighting (43.36 KB, image/png)
2016-01-24 18:56 UTC, Tobias Schönberg
  Details
Add better support for at-media query highlighting (12.23 KB, patch)
2016-01-31 14:50 UTC, Tobias Schönberg
none Details | Review
Add better support for at-media query highlighting (5.35 KB, patch)
2016-01-31 16:43 UTC, Tobias Schönberg
none Details | Review

Description Tobias Schönberg 2016-01-24 18:56:50 UTC
Created attachment 319617 [details]
screenshot showing bugs in at-media rule highlighting

The highlighting of at-media rules has some problems:

 - The media types (screen, print etc..) are highlighted the same as html-elements.

 - The 'and' keyword is also highlighted the same as an html element.

 - The Media Feature is also highlighted the same as an html element.

 - Within the round brackets units and numbers are not highlighted.

 - Within the curly brackets classes, ids and html elements are not highlighted.

 - Nesting leads to different but also inconsistent behaviour.
Comment 1 Tobias Schönberg 2016-01-31 14:50:35 UTC
Created attachment 320128 [details] [review]
Add better support for at-media query highlighting

Currently syntax highlighting has an inconistent behaviour
after an at-media query. The patch adds some better rules
to handle the contex highlighting, especially if the
calls are nested. To correctly highlight the media
queries the patch adds contexts for screen resolutions,
media-features and media-feature values.
The patch also adds a test file that lists all css2
properties and values, css2 named colors, and some
examples of at-rules and nested at-media queries.

https://bugzilla.gnome.org/show_bug.cgi?id=761056
Fixes #761056
Comment 2 Tobias Schönberg 2016-01-31 16:43:58 UTC
Created attachment 320135 [details] [review]
Add better support for at-media query highlighting

Currently syntax highlighting has an inconistent behaviour
after an at-media query. The patch adds some better rules
to handle the contex highlighting, especially if the
calls are nested. To correctly highlight the media
queries the patch adds contexts for screen resolutions,
media-features and media-feature values.
The patch also adds a css test file.

https://bugzilla.gnome.org/show_bug.cgi?id=761056
Fixes #761056
Comment 3 Paolo Borelli 2016-01-31 16:49:28 UTC
great!