Reply To: Customize slider

PennController for IBEX Forums Support Customize slider Reply To: Customize slider

#7137
Jeremy
Keymaster

Hi,

If you haven’t read it yet, I recommend you take look at this guide: Adding custom CSS

However the code I use to parse CSS at the PCIbex Farm has some bugs, so it’s often a better idea to edit global_main.css directly rather than relying on PennController.css automatically prefixing class names with PennController-. Another tricky thing is that when generating class names from element names, PennController will drop all underscores (_) so your Scale element’s CSS class name will be MainSlider, not Main_Slider

Here is what I added to global_main.css to get the desired rendering:

.PennController-MainSlider {
  width: 100%; /* Width of the outside container */
}

/* The slider itself */
.PennController-MainSlider input {
  -webkit-appearance: none;  /* Override default CSS styles */
  appearance: none;
  width: 100%; /* Full-width */
  height: 25px; /* Specified height */
  background: #d3d3d3; /* Grey background */
  outline: none; /* Remove outline */
  opacity: 0.7; /* Set transparency (for mouse-over effects on hover) */
  -webkit-transition: .2s; /* 0.2 seconds transition on hover */
  transition: opacity .2s;
}

/* Mouse-over effects */
.PennController-MainSlider input:hover {
  opacity: 1; /* Fully shown on mouse-over */
}

/* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) */
.PennController-MainSlider input::-webkit-slider-thumb {
  -webkit-appearance: none; /* Override default look */
  appearance: none;
  width: 25px; /* Set a specific slider handle width */
  height: 25px; /* Slider handle height */
  background: #04AA6D; /* Green background */
  cursor: pointer; /* Cursor on hover */
}

.PennController-MainSlider input::-moz-range-thumb {
  width: 25px; /* Set a specific slider handle width */
  height: 25px; /* Slider handle height */
  background: #04AA6D; /* Green background */
  cursor: pointer; /* Cursor on hover */
}

Let me know if you have questions

Jeremy