mendix - Customize the color of a progress circle
问题描述
I'm using the "Progress circle" widget (version 2.0.0) in Mendix Studio Pro 9.2.0, and I would like to individually change the color(s) of each one of my progress circles, primarily the part that is shown in blue by default. By looking into Chrome DevTools, I found that the attribute stroke
might be storing the color, but I'm not sure. Adding stroke: red
in the Appearance
> Common
> Style
form didn't work. On the other hand, adding background: red
did have the intended effect of changing the background of the progress circle.
Can anyone help? I'm quite new to Mendix, so any help from you would be greatly appreciated.
解决方案
By going into the documentation i found the source code of the widget. Check this link: https://github.com/mendixlabs/progress-circle/tree/master/src/ui In the ui folder there is a theme.scss and _variables.scss in which the developer defines the variables which drive the colors or theme of the widget. You could take some hints from there. I am not suggesting to rebuild the widget but you can certainly do so by downloading the widget (.mpk gets downloaded) and then change the extension to .zip then change the source code. Or since you can already inspect the DOM of the widget you can do: give a class to the widgets root DOM element. and then using cascading CSS selectors you can drill down to the element which affects background.
推荐阅读
- python - 如何从另一个目录调用 Python 脚本
- ajax - 使用 AJAX 表达 PATCH 请求:“(”或附近的语法错误
- c# - 在 C# 中除以 2 个浮点数时增加精度
- asp.net - 单击面板会导致异步回发,但单击子项会导致整页回发
- c# - SQLite 异步任务和等待运算符 - 任务会以正确的顺序执行吗?
- python - 在 mac 上安装 Django+MySql
- php - PHP 无法连接到实时 Web 服务器上的 MySql 数据库
- scala - 简单推理算子 Apache Flink
- matlab - 在 Matlab 中使用多个坐标裁剪图像
- javascript - 如何使用 React、fetch 和 Django REST 上传图像