I’m a bit confused about what you are trying to apply to what. For the CSS you posted, did you mean to apply it to the div with a class of .body or the body element? Your selector is for the body element not the div.
It would help to see the code live but as you are using Svelte you would have to use something like stackblitz, or you would need to build it and post a live version of the public folder.
Not 100% sure but I think there might be some stacking context issue. Try giving the h1 a container div and set the background color on it instead. You also need to apply mix-blend-mode to the text and not the background (if I understand what you want correctly).
Here is a super simple example, where the text is green from blending the yellow and red.
You are still applying mix-blend-mode to the background, you want it on the text. The text is in front of the background and you blend it with the background.
I thought the image you posted was of your site, that is why I was talking about Svelte. As far as I can tell, it is blending the text with a background image. How well that works depends on the color of the text and the color of the image.
If the text is on top of an image how can it be a negative of the background color? It doesn’t sit on top on the background color so it can’t blend with it.
Are you saying when you click the logo it changes the background from an image to a solid color?
Because the text is not on the background color, it’s on the image. It can not both blend with the image and a background color. The image can blend with a background color using background-blend-mode and you can then also blend the text using mix-blend-mode.
Here are two examples.
I’m also not exactly sure what your definition of negative is. Here is the definition of the difference blend mode from Photoshop.
Looks at the color information in each channel and subtracts either the blend color from the base color or the base color from the blend color, depending on which has the greater brightness value. Blending with white inverts the base color values; blending with black produces no change.
There is an invert filter as well filter: invert(1).