Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

useCss !important not possible

Abierto
#2,644 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
css, react, typescript
Área
frontend

Línea de trabajo

Start by locating the useCss hook and reproduce the reported example with color: 'red !important' alongside padding: 5. Confirm that the generated CSS includes both declarations, with the color value retaining !important, and verify that ordinary declarations still render correctly.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What is the current behavior?
Properties with !important will not be rendered in the generated css class, not even without the !important-flag.

The following Example:

const myComponent = ()=> {
  const styleClass = useCss({
    color: 'red !important',
    padding:5,
  })

  return <div class={styleClass}>TEST</div>
}

RENDERS:

<style>
.react-use-css-1x {
  padding:5px;
}
</style>

<div class="react-use-css-1x">TEST</TEST>

The color-Property is completely ignored and not part of the rendered css, not even without the !important.
Without the !important all functions well.

The expected Result is:

<style>
.react-use-css-1x {
  color: red !important;
  padding:5px;
}
</style>

<div class="react-use-css-1x">TEST</TEST>

A little about versions:

  • OS:
  • Browser (vendor and version):
  • React: 18.2.0
  • react-use: 17.6.0
  • Did this worked in the previous package version? NO
Lenguaje dominante
TypeScript
Estrellas
44k
Forks
3.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de streamich/react-use

Todos los issues de streamich/react-use

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.