digitalfabrik / lunes-app

The front end for the Lunes vocabulary trainer. Back end: https://github.com/digitalfabrik/lunes-cms
https://lunes.app
Apache License 2.0
23 stars 5 forks source link

LUN-356: Refactoring SVG Icons in different colors #794

Open jira-to-github-migrator[bot] opened 10 months ago

jira-to-github-migrator[bot] commented 10 months ago

f1sh1918 - 24.5.2022, 13:57:19

Currently we are using multiple svg files for icons that just differ in color f.e:

import CheckCircleIconGreen from './check-circle-icon-green.svg'
import CheckCircleIconWhite from './check-circle-icon-white.svg' 

CSS enables you to use the "currentColor" Attribute to set the fill-color of a svg. So you can use the css color attribute to adjust the color you want to use instead of setting it fixed in the svg file.

Example:

<g fill="currentColor">
const BookIconGrey = styled(BookIcon) `
color: grey;

Acceptance Criteria

Environment: - Linked issues:

See how this was done in integreat: https://github.com/digitalfabrik/integreat-app/pull/2378

jira-to-github-migrator[bot] commented 10 months ago

Charlotte Paludo - 27.9.2022, 08:26:00

Proposed solution: svgr provides the option to override colors:

<ExampleSvgIcon fill="#333" stroke="#abc" />

This works by mapping specific color codes to variable names, e.g. svgr can be configured to always replace the color #001 inside a svg file with whatever color is passed to the icon via the fill variable.

Current problems:

Suggestions:

IsabellaTG commented 9 months ago

@f1sh1918 @charludo Is a color palette still needed? The current used color palette in the Figma concepts was already created by Nikola or is this issue about an updated color palette request?

https://www.figma.com/file/4bW33nU6zZ6ySeTqrM37Jq/Lunes_Master?type=design&node-id=0%3A544&mode=design&t=85ALRR2wnJKYQ8HT-1

sarahsporck commented 5 months ago

I guess the color palett was not prominent enough @f1sh1918 . Do you still need more design input here?

f1sh1918 commented 5 months ago

I guess the color palett was not prominent enough @f1sh1918 . Do you still need more design input here?

No idea. My base ticket Was just about not duplicating svgs that just differ in color.

As now it seems quite complicated, i wouldnt put more effort in it