Reputation: 7381
I have made a menu with primeNG's p-menu component and i wish to shift the items of the menu a bit more to the left. I think i should use padding for that and i tried the following to shift it a few pixels.
<p-menu [model]="items" [style]="{minWidth:'18.8em', background: 'white',
padding: .625em 0 0 0}"></p-menu>
but this is giving me a syntax error, this is the stack trace:
[ERROR ->]) at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileComponents (compiler.js:22639) at compiler.js:22549 at Object.then (compiler.js:206) at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:22548)
The menu itself looks like this:
What am i doing wrong?
Upvotes: 1
Views: 3819
Reputation: 28708
The <p-menu>
has 'ui-menu'. Style it in the component stylesheet with
::ng-deep
::ng-deep .ui-menu {
padding: .625em 0 0 0
}
ViewCansulation turned off:
import { ViewEncapsulation } from '@angular/core';
...
@Component({
...
encapsulation: ViewEncapsulation.None
})
.ui-menu {
padding: .625em 0 0 0
}
Upvotes: 2