packages/datasheet/src/pc/styles/global_components/readme.md
less Index path
See https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less for overridable variable names
The first 150 lines are all generic style related variables.
Colors, fonts, spacing, borders, shadows, etc. are modified in [custom_antd_style.less](. /custom_antd_style.less).
Overriding variable names & overriding class names are written uniformly in the Component names.less file under this directory (src/pc/styles/global_components)
Take overloading Slider component as an example.
slider.less and comment them out.For example, change the background color of the slider default track and the background color of the hover to our brand color.
// @slider-margin: 10px 6px 10px;
@slider-track-background-color: @primaryColor;
@slider-track-background-color-hover: @primaryColor;
// @slider-track-background-color: @primary-3;
// @slider-track-background-color-hover: @primary-4;
// @slider-handle-border-width: 2px;
// @slider-handle-background-color: @component-background;
// @slider-handle-color: @primary-3;
// @slider-handle-color-hover: @primary-4;
// @slider-handle-color-focus: tint(@primaryColor, 20%);
// @slider-handle-color-focus-shadow: fade(@primaryColor, 20%);
// @slider-handle-color-tooltip-open: @primaryColor;
// @slider-handle-shadow: 0;
// @slider-dot-border-color: @lineColor-split;
// @slider-dot-border-color-active: tint(@primaryColor, 50%);
// @slider-disabled-color: @disabled-color;
// @slider-disabled-background-color: @component-background;
When overriding the variable name is not possible, you can override the class name.
For example, the height of the slider component on the design is 2px. The slider component does not expose props like height for us to customize the height. The variable names above also do not expose the relevant configuration.
We can override the corresponding css class name in the slider component (you need to find it yourself using browser devtools)
.ant-slider{
.ant-slider-track{
height: 2px;
}
}