Coder Social home page Coder Social logo

Comments (8)

jelowin avatar jelowin commented on May 22, 2024

Parece que tiene que ver con estos estilos de global.css

html[scheme='light-mode'] body {
  --app-background:
    radial-gradient(#cdd0ff 1px, transparent 0),
    radial-gradient(#cdd0ff 1px,#fefefe 0);
}
html[scheme='light-mode'] #__next {
  filter: invert(0) hue-rotate(0deg);
}

html[scheme='light-mode'] #__next img,
html[scheme='light-mode'] #__next span[role='img'] {
  filter: invert(0) hue-rotate(0deg);
}

html[scheme='dark-mode'] body {
  --app-background:
    radial-gradient(#15155a 1px, #111 0),
    radial-gradient(#15155a 1px,#111 0);
}
html[scheme='dark-mode'] #__next {
  filter: invert(1) hue-rotate(180deg);
}

html[scheme='dark-mode'] #__next img,
html[scheme='dark-mode'] #__next span[role='img'] {
  filter: invert(1) hue-rotate(180deg);
}

---UPDATE---
En concreto son estos dos estilos los que provocan el fallo

html[scheme="light-mode"] #__next {
  filter: invert(0) hue-rotate(0deg);
}
html[scheme="dark-mode"] #__next {
  filter: invert(1) hue-rotate(180deg);
}

from covid-vacuna.

midudev avatar midudev commented on May 22, 2024

He hecho merge de la PR de @jelowin. A ver si puedes comprobar si sigue pasando. :)

from covid-vacuna.

daniperezluna avatar daniperezluna commented on May 22, 2024

Para el selector de modo oscuro sirve este fix, pero para los tooltip del mapa no. Sigue ocurriendo lo mismo, si seleccionas un modo diferente al del sistema y se le agrega a la etiqueta HTML el scheme dark o light falla. Es como si perdiera la referencia del parent, ayer lo estuvimos hablando por privado y cuando hizo Jelowing el commit lo probé.

from covid-vacuna.

daniperezluna avatar daniperezluna commented on May 22, 2024

He estado observando que en safari funciona correctamente sin aplicar ningún tipo de cambio al código. Probando el enlace que crea Vercel para la preview de mi PR he visto que todo se muestra bien
Probad a verlo en Safari
https://covid-vacuna-git-fork-daniperezluna-main.midudev.vercel.app/

from covid-vacuna.

daniperezluna avatar daniperezluna commented on May 22, 2024

He encontrado esto en la documentación del filter, tiene todo el sentido del mundo, al crear ese bloque, el descendiente pierde la referencia:

A value other than none for the filter property results in the creation of a containing block for absolute and fixed positioned descendants unless the element it applies to is a document root element in the current browsing context. The list of functions are applied in the order provided.

https://drafts.fxtf.org/filter-effects/#FilterProperty

from covid-vacuna.

sergioedo avatar sergioedo commented on May 22, 2024

vaya currazo @daniperezluna, al final llegaste al origen del problema. @midudev ¿ves viable abordar el dark mode sin usar el "truco" de aplicar estilos globales? ¿o otro truco para que un componente no se vea afectado? (intenté evitar el filter sobre el mapa con algun selector, pero no domino nada CSS...) Al final estamos alterando de manera global los estilos, cuando la gracia de los componentes es que tengan estilado independiente.

from covid-vacuna.

midudev avatar midudev commented on May 22, 2024

Sí, al final lo que se podría hacer es un dark mode a mano, que era la idea original. Habría que sacar tiempo y usar más las variables para hacerlo. :D

from covid-vacuna.

sergioedo avatar sergioedo commented on May 22, 2024

Ahi va la PR, @midudev @daniperezluna @jelowin echadle un vistazo a ver cómo la veis (es mi primer dark mode!) Intenté tocar lo mínimo (por suerte había mucho ya en ficheros CSS separados)

from covid-vacuna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.