ColorPicker: *.png missing
Describe the bug
By following the installation guide the png-files are missing, and the color picker is broken. (fore example the hue.png is missing)
Environment
Angular CLI: 16.2.4 Node: 18.17.0 Package Manager: npm 9.8.1 Windows: 10 IDE: Intellij Community
Reproducer
No response
Angular version
16.2.4
PrimeNG version
16.4.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.17.0
Browser(s)
No response
Steps to reproduce the behavior
- Angular application setup with sass for styling
- Follow the installation guide.
- Use the ColorPicker in a project.
Expected behavior
Displaying that way, no error messages or anything else in dev tools.
Files are in the node_modules folder
I found a fix: Add the following to the top level styles.sass
/* You can add global styles to this file, and also import other style files */
.p-colorpicker-panel .p-colorpicker-color
background: transparent url("./images/color.png") no-repeat left top
.p-colorpicker-panel .p-colorpicker-hue
background: transparent url("./images/hue.png") no-repeat left top
The problem seems to be the styles generator that throws away the css styles of colorpicker-images.css
I cannot reproduce. I added in my project and all is working perfectly.
Maybe is better if you share a stackblitz or give more information.
Thanks
@SoyDiego i think the op used sass theme https://github.com/primefaces/primeng-sass-theme/blob/main/theme-base/components/input/_colorpicker.scss which doesn't have the backround style and indeed there is no background
Shouldn't colorpicker-images.css be included in colorpicker component? https://github.com/primefaces/primeng/blob/7216049475cdde34593d321181dbbb174e164dd8/src/app/components/colorpicker/colorpicker.ts#L74C38-L74C38
Hi,
Could you please share a stackblitz reproducer so we can identify the issue clearly?
@cetincakiroglu Looks like the resource images are corrupted in the latest build. I replaced the images and added some style in css. It worked.
FYI: style.css / style.scss
/* You can add global styles to this file, and also import other style files */
.p-colorpicker-panel .p-colorpicker-color {
background: transparent url("assets/img/custom-color.png") no-repeat left top
}
.p-colorpicker-panel .p-colorpicker-hue {
background: transparent url("assets/img/custom-hue.png") no-repeat left top !important;
}
custom-color.png
custom-hue.png
same
Same here. Both versions 17.18.10 and 17.18.11 (with Angular 18).
Hi,
Could you please share a stackblitz reproducer so we can identify the issue clearly?
If you want to reproduce, simply go to color picker on the primeng.org website (https://primeng.org/colorpicker) and select the Stackblitz for the Basic example
Downgrading to 17.18.10 seems to be the solution for the time being...
Hi,
So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation and try the latest PrimeNG version(v19). If there is no improvement on this, can you open a new issue so we can include it in our roadmap?
Thanks a lot for your understanding! Best Regards,
Hi @mertsincan @cetincakiroglu, this is still an issue...so many PrimeNG issues have been recently closed in a rush since the PrimeNG 18.0.0 release which are still issues and are even present even in newer releases like PrimeNG 19.0.2.
It has been present since PrimeNG 17.18.11 and all subsequent releases.
Please fix this and please make sure to backport this fix to release PrimeNG 17.18.16 (non-LTS), many users can no longer use the ColorPicker since the 17.18.11 release 3 months ago without downloading the working images manually (see the working 17.18.10 links below) and overriding the global styles for class .p-colorpicker-panel .p-colorpicker-color/hue (see https://github.com/primefaces/primeng/issues/13820#issuecomment-2430890678).
Make sure to rename the color.png and hue.png files else you will get the build errors:
X [ERROR] Two output files share the same path but have different contents: media\color.png
X [ERROR] Two output files share the same path but have different contents: media\hue.png
Related tickets: https://github.com/primefaces/primeng/issues/16449 https://github.com/primefaces/primeng/issues/16538 https://github.com/primefaces/primeng/issues/16586
The resources/images are working in PrimeNG 17.18.10: https://unpkg.com/browse/[email protected]/resources/images/ https://unpkg.com/browse/[email protected]/resources/images/color.png https://unpkg.com/browse/[email protected]/resources/images/hue.png https://unpkg.com/browse/[email protected]/resources/images/password-meter.png
They are no longer working/corrupted in the following PrimeNG versions, see for yourself by clicking the .png links. Something must have changed in the release process https://github.com/primefaces/primeng/compare/17.18.10...17.18.11 -> https://github.com/primefaces/primeng/blob/17.18.11/gulpfile.js#L39-L41
- 17.18.11 https://unpkg.com/browse/[email protected]/resources/images/ https://unpkg.com/browse/[email protected]/resources/images/color.png https://unpkg.com/browse/[email protected]/resources/images/hue.png https://unpkg.com/browse/[email protected]/resources/images/password-meter.png
- 17.18.12 https://unpkg.com/browse/[email protected]/resources/images/ https://unpkg.com/browse/[email protected]/resources/images/color.png https://unpkg.com/browse/[email protected]/resources/images/hue.png https://unpkg.com/browse/[email protected]/resources/images/password-meter.png
- 17.18.13 https://unpkg.com/browse/[email protected]/resources/images/ https://unpkg.com/browse/[email protected]/resources/images/color.png https://unpkg.com/browse/[email protected]/resources/images/hue.png https://unpkg.com/browse/[email protected]/resources/images/password-meter.png
- 17.18.14 This release is completely broken, compare https://unpkg.com/browse/[email protected]/ with https://unpkg.com/browse/[email protected]/ https://unpkg.com/browse/[email protected]/resources/images/ https://unpkg.com/browse/[email protected]/resources/images/color.png https://unpkg.com/browse/[email protected]/resources/images/hue.png https://unpkg.com/browse/[email protected]/resources/images/password-meter.png
- 17.18.15 https://unpkg.com/browse/[email protected]/resources/images/ https://unpkg.com/browse/[email protected]/resources/images/color.png https://unpkg.com/browse/[email protected]/resources/images/hue.png https://unpkg.com/browse/[email protected]/resources/images/password-meter.png
@mertsincan @cetincakiroglu Guys, I'd appreciate if you can review tomorrow. There is a lot of demand from our users about this one. The brand new ColorPicker can wait, as we should make the current one right.
Could you please try;
.p-colorpicker-panel .p-colorpicker-color-background {
width: 100%;
height: 100%;
background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%), linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%) !important;
}
.p-colorpicker-panel .p-colorpicker-hue {
background: linear-gradient(0deg, red 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, red) !important;
}
This will be automatically fixed in v20 since we're moving to shared primeuix, right now PrimeNG has its own fork. Still I think we should fix it for v19.1.x.