Why I'm not getting proper styling with p-calendar [PrimeNG]

谁说我不能喝 提交于 2019-12-14 03:01:57

问题


I'm learning Angular. I'm working on a project. I decided to add a <p-calendar>component from primeng. I installed the packages also. The versions were:

"primeicons": "^2.0.0",
"primeng": "^5.2.7",

I was getting everything perfectly. See this:

But now when I want to get months only. I wanted to change it to month picker. After doing some research I came to know that month only picker is not available in primeng: ^5.2.7. So i upgraded to:

"primeicons": "^2.0.0",
"primeng": "6.1.6",

and I also added these attributes to <p-calendar> tag:

view="month" dateFormat="mm/yy"

Component is working fine. But Why I lost all the styling. Those circles and hover effects, etc. See this:

Honestly, I'm not very good at css and styling. Please help.

My angular.json:

"styles": [
    "src/styles.scss",
    "node_modules/primeng/resources/primeng.min.css",
    "node_modules/primeicons/primeicons.css",
    "node_modules/bootstrap/dist/css/bootstrap.min.css"
]

Is there any way to edit or overwrite the designs.


回答1:


https://www.primefaces.org/primeng/#/setup

Try adding themes inside styles array:-

angular.json

"styles": [
   "node_modules/bootstrap/dist/css/bootstrap.min.css",
   "node_modules/primeng/resources/primeng.min.css",
   "node_modules/primeng/resources/themes/omega/theme.scss",
   "node_modules/primeicons/primeicons.css"
]


来源:https://stackoverflow.com/questions/58900995/why-im-not-getting-proper-styling-with-p-calendar-primeng

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!