@@ -10,11 +10,12 @@ A web component for displaying the steps of a process and letting users move bet
1010
1111### CDN
1212
13- Use the built file from npm from https://unpkg.com/progress-steps-webcomponent@latest
13+ Use the built files from npm from https://unpkg.com/progress-steps-webcomponent@latest
1414
1515``` html
16- <!-- For example -->
17- <script src =" https://unpkg.com/progress-steps-webcomponent@latest" ></script >
16+ <!-- For example, use a CDN and replace 'latest' with your intended version -->
17+ <link rel =" stylesheet" href =" https://unpkg.com/progress-steps-webcomponent@latest/dist/progress-steps.min.css" />
18+ <script src =" https://unpkg.com/progress-steps-webcomponent@latest/dist/progress-steps.min.js" ></script >
1819```
1920
2021### Manual
2627npm run build
2728```
2829
29- And use the ` dist/progress-steps.min.js ` file
30+ And use the ` dist/progress-steps.min.js ` and ` dist/progress-steps.min.css ` files
3031
3132## Configuration
3233
@@ -94,53 +95,56 @@ myStepper.init({
9495
9596### Styling
9697
97- Styling can be overridden by passing in CSS values to the ` style ` object. All options are entirely optional.
98- The most commonly overridden value would be that of the color that the bar fills up with, ` progressFillColor `
99-
100- ``` js
101- myStepper .init ({
102- steps: [
103- ...
104- ],
105- style: {
106- // The width of each step icon
107- stepWidth: 20 ,
108- // The font size of the step number and label
109- fontSize: 12 ,
110- // The border radius of the step icon
111- borderRadius: ' 25%' ,
112- // The thickness of the line/progress bar/borders
113- lineThickness: 2 ,
114- // The animation speed of the progress bar filling up
115- animationSpeed: ' 500ms' ,
116- // Whether or not to show labels or not
117- showLabels: true ,
118- // The vertical margin of the labels, if shown
119- labelSpacing: 5 ,
120- // The font weight to use on step labels
121- stepLabelFontWeight: ' normal' ,
122- // The font color of step labels that are before the current step
123- previousLabelFontColor: ' red' ,
124- // The font color of the current step label
125- currentLabelFontColor: ' blue' ,
126- // The font weight of the current step label
127- currentStepLabelFontWeight: ' bold' ,
128- // The font color of step labels that are after the current step
129- futureLabelFontColor: ' green' ,
130- // The font color of step labels that are disabled
131- disabledLabelFontColor: ' maroon' ,
132- // The color to fill up, left-to-right, as steps are set to active
133- progressFillColor: ' #cf78d9' ,
134- // The default color of the unfilled section of line and steps after the active step
135- progressUnfilledColor: ' #d5dce2' ,
136- // The font color of the step icon that is currently active
137- currentStepFontColor: ' white' ,
138- // The fill-color for step icons that are after the current active step
139- futureStepFillColor: ' orange' ,
140- // The font color of the disabled steps
141- disabledStepFontColor: ' red' ,
142- // The fill-color for disabled step icons
143- disabledStepFillColor: ' blue'
144- },
145- });
146- ```
98+ Styling defaults can be overridden by overriding CSS variables on your component instance:
99+
100+ ``` css
101+ /* Ugly but complete style override demonstrating all the style components */
102+ #my-steps {
103+ /* The color to fill up, left-to-right, as steps are set to active */
104+ --progress-fill-color : #cf78d9 ;
105+ /* The default color of the unfilled section of line and steps after the active step */
106+ --progress-unfilled-color : purple ;
107+
108+ /* The width of each step icon */
109+ --step-width : 20px ;
110+ /* The font size of the step number and label */
111+ --font-size : 12px ;
112+ /* The border radius of the step icon */
113+ --step-border-radius : 25% ;
114+ /* The thickness of the line/progress bar/borders */
115+ --line-thickness : 3px ;
116+
117+ /* The animation speed of the progress bar filling up */
118+ --animation-speed : 500ms ;
119+ /* Display attribute of the step labels. Show: 'inline-block', hide: 'none' */
120+ --step-label-display : ' inline-block' ;
121+ /* The vertical margin of the labels, if shown */
122+ --step-label-spacing : 5px ;
123+ /* The font weight to use on step labels */
124+ --step-label-font-weight : normal ;
125+
126+ /* The font color of the step icon that is currently active */
127+ --current-step-font-color : red ;
128+ /* The font color of the current step label */
129+ --current-label-font-color : blue ;
130+ /* The font weight of the current step label */
131+ --current-label-font-weight : bold ;
132+
133+ /* The font color of step labels that are before the current step */
134+ --previous-label-font-color : red ;
135+ /* The font color of the step icons that are before the current step */
136+ --previous-step-font-color : pink ;
137+
138+ /* The fill-color for step icons that are after the current active step */
139+ --future-step-fill-color : orange ;
140+ /* The font color of step labels that are after the current step */
141+ --future-label-font-color : green ;
142+
143+ /* The font color of step labels that are disabled */
144+ --disabled-label-font-color : maroon ;
145+ /* The font color of the disabled steps */
146+ --disabled-step-font-color : red ;
147+ /* The fill-color for disabled step icons */
148+ --disabled-step-fill-color : blue ;
149+ }
150+ ```
0 commit comments