Skip to content

Commit

Permalink
gui/styles: Quote file types in stylus loop (#1949)
Browse files Browse the repository at this point in the history
The file type icons CSS rules are generated from a simple loop over
all the types we're supporting.
One of those types is `text`.

However, if those are not quoted, stylus will use the value of any
existing variable with that given name in interpolations instead of
the string itself.
Since we import the `button` component module from `cozy-ui` and a
`text` variable is defined in this module, the generated rule for this
file type was a mess and the associated icon would not be displayed in
the Recent list in the main window.

By quoting the types in the loop argument, we make sure those will be
interpreted as strings and not variables.
  • Loading branch information
taratatach authored Sep 7, 2020
1 parent ece1d80 commit 08b93ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gui/styles/_two_panes.styl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
background-size cover
background-position center center

for mimetype in archive audio binary code contact cozy-note file folder image link pdf presentation spreadsheet text video
for mimetype in 'archive' 'audio' 'binary' 'code' 'contact' 'cozy-note' 'file' 'folder' 'image' 'link' 'pdf' 'presentation' 'spreadsheet' 'text' 'video'
&.file-type-{mimetype}
background-image url("./images/type-icons/icon-type-" + mimetype + ".svg")

Expand Down

0 comments on commit 08b93ae

Please sign in to comment.