Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation: preset theming and css() function positioning within the theme declaration is wrong #6790

Open
petitkriket opened this issue Nov 15, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@petitkriket
Copy link

petitkriket commented Nov 15, 2024

Describe the bug

There is a documented example to inject css when using the Primevue v4 preset.
The documentation example does not work, and I suspect that there is an error in the documentation.

const MyPreset = definePreset(Lara, {
  components: {
    tag: {
      // inside a component itself, works 🎉 
      css: ({ dt }) => ``,
  },
  // inside the `components:` at the same level of other components like seen in the theme `extend` documentation section ❌
        css: ({ dt }) => `
.p-toggleswitch.p-disabled .p-toggleswitch-slider {
    opacity: ${dt('toggleswitch.my.disabled.opacity')};
}

.p-toggleswitch.p-disabled .p-toggleswitch-handle {
    background: ${dt('toggleswitch.my.checked.disabled.background')};
}
`
    }
});

On the other hand, when i place the css property within the tag or button object itself, it works

The css property has to be within the component itself.- material theme working example at an atomic component preset level.

On the root position of the theme object it seems to work, see material theme root declaration. But it's empty so it's unclear.

Reproduction

a simple reproduction

Proposition

  1. Can you clarify if both or all the 3 uses should be working ?
  2. If not, updating the docs could help

Reproducer

PrimeVue version

4.2.2

Vue version

4.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. add css customization and or extended Design Token to the theme.
  2. inspect the DOM and see that the given properties are not applied

Expected behavior

  1. add css customizations with or without design tokens
  2. see that the css is properly injected and enjoy Tags with a thin border.
@petitkriket petitkriket added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 15, 2024
@petitkriket petitkriket changed the title documentation : preset theming css() function positioning within the theme declaration is wrong documentation: preset theming and css() function positioning within the theme declaration is wrong Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant