Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DX] Symfony logo in dark mode #53105

Copy link
Copy link
@smnandre

Description

@smnandre
Issue body actions

I find the white square around the logo a bit rought, and would like to suggest a little modification that would improve the look of all the README pages

  • on github.com
  • in your IDE (phpstorm there)

And the good news is ... there is only one file to update :)

What it could render

dark-mode

Before / After

Github.com

Before After
before-readme after-readme

phpstorm

Before After
before-phpstorm after-phpstorm

How can it be done

The good news is that you would just have to update the logo file which is linked in all those README :

<p align="center"><a href="https://symfony.com" target="_blank">
    <img src="https://symfony.com/logos/symfony_black_02.svg">
</a></p>

By adding a couple of lines of CSS in the SVG, the logo can be modified depending on the user dark/light mode

Let's use a simplified SVG code for the Symfony logo

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 288 122">
  <path id="circle" d="..."/>
  <path id="sf" fill="#fff" d="..."/>
  <path id="symfony" d="..."/>
</svg>

Solution 1 : Filter Invert

If you want to get a quick win, you can simply invert the image via the invert filter

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 288 122">
  <style>
    @media (prefers-color-scheme: dark) { 
      path { filter: invert(1) }
    }
  </style>
  <path id="circle" d="..."/>
  <path id="sf" fill="#fff" d="..."/>
  <path id="symfony" d="..."/>
</svg>

Solution 2 : Manual override

Personnaly, i'd rather write things explicetly, so you could do it like that too (or in a dozen of other ways i guess... 😅 )

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 288 122">
  <style>
    @media (prefers-color-scheme: dark) { 
      path { fill: #fff; }
      #sf { fill: #000; }
    }
  </style>
  <path id="circle" d="..."/>
  <path id="sf" fill="#fff" d="..."/>
  <path id="symfony" d="..."/>
</svg>

What do you think ?

GromNaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.