0

HI in the below stackblitz link , I have two controls , one is primeng splitbutton and another is bootstrap button .

https://stackblitz.com/edit/angular6-primeng-hlxeod?file=src/app/app.component.html

I am not able to customize the splitbutton width and color to make it look alike bootstrap button . please share any suggestions

I have tried styleClass and styles inline but its not getting reflected .

In My actual application , I have many other controls so it has t be done with class to control only that specific splitbutton

Shaswata
  • 1,049
  • 1
  • 9
  • 27

2 Answers2

0

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn:hover, .btn:focus {
  text-decoration: none;
}

.btn:focus, .btn.focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn.disabled, .btn:disabled {
  opacity: 0.65;
}

.btn:not(:disabled):not(.disabled) {
  cursor: pointer;
}

.btn:not(:disabled):not(.disabled):active, .btn:not(:disabled):not(.disabled).active {
  background-image: none;
}

.btn-primary {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.btn-primary:hover {
  color: #fff;
  background-color: #0069d9;
  border-color: #0062cc;
}

.btn-primary:focus, .btn-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.btn-primary.disabled, .btn-primary:disabled {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.btn-primary:not(:disabled):not(.disabled):active, .btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
  color: #fff;
  background-color: #0062cc;
  border-color: #005cbf;
}

.btn-primary:not(:disabled):not(.disabled):active:focus, .btn-primary:not(:disabled):not(.disabled).active:focus,
.show > .btn-primary.dropdown-toggle:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}
<button class='btn btn-primary'>here</button>

Bootstrap applied :focus and :hover etc

duck
  • 141
  • 1
  • 9
  • this made it stopped functions of the split button , split button has a dropdown too – Shaswata Aug 17 '20 at 11:21
  • have a look at [how to overwrite primeng component style?](https://stackoverflow.com/questions/40131174/what-is-best-way-to-override-the-style-of-primeng-components) – duck Aug 18 '20 at 01:24
0

So I figured it out , when I put the css in global styles.scss it is able to implement and change the css . you can use styleClass or class to make it specific , because in dependenices.json the styles should come after the primeng css classes thats why it can override

Shaswata
  • 1,049
  • 1
  • 9
  • 27