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

Question about CSS support in pseudo-elements #70

Open
jiyuujin opened this issue Mar 6, 2023 · 5 comments
Open

Question about CSS support in pseudo-elements #70

jiyuujin opened this issue Mar 6, 2023 · 5 comments

Comments

@jiyuujin
Copy link

jiyuujin commented Mar 6, 2023

I'd like to hear about the behavior of css support in pseudo-elements.
I think it don't work properly below.

Environment:

  • node.js 16.18.1
  • nuxt 3.2.0
  • pinceau 0.18.0
css({
  '.title': {
    'h3': {
      position: 'relative',
      '&::before': {
        content: '',
        position: 'absolute',
        top: '50%',
        left: 0,
        display: 'inline-block',
        width: '45px',
        height: '1px',
        backgroundColor: '#fff',
      },
    },
  },
})

Is there anything that seems strange to you?

@SGAMERyu
Copy link
Contributor

can you provide a minimum reproducible available repository

@jiyuujin
Copy link
Author

Sample repository have been created, and please check it

@SGAMERyu
Copy link
Contributor

It should be that the content property is erased for the string, and I made a judgment call in this pr #77

.test::before {
   content: 
}

Therefore, the style does not take effect

@SGAMERyu
Copy link
Contributor

SGAMERyu commented Apr 10, 2023

@jiyuujin
I have noticed that the 'content' property in CSS can be manipulated using the "''" syntax. However, it does not handle errors well when dealing with quotation marks enclosed in double quotes.

@Tahul
Copy link
Owner

Tahul commented Sep 12, 2023

I'm bumping this as I should think of a better solution than #77 ;

For now I'm pretty sure you can workaround this issue using:

defineTheme({
   utils: {
      content: (value) => value ? value : `\'\'`
   }
})

Utils properties can also be used to overwrite native css properties behavior :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants