我正在尝试使用自定义样式覆盖 ng2-bootstrap 手风琴 css 样式,但该样式未得到应用
html
<ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0">
<ngb-panel class="customclass1" title="Simple">
<ng-template ngbPanelContent>
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher …Run Code Online (Sandbox Code Playgroud)什么是从宿主组件覆盖子组件样式的正确方法。我尝试使用, encapsulation: ViewEncapsulation.None但是我需要在style.sass文件而不是主机组件中编写替代内容。什么是堆叠闪电战
我试图在其父组件悬停时显示我的组件。
当元素悬停时,该action-list组件将显示可能操作的列表。目标是有一种上下文操作。
我用来host-context检测父级何时悬停,但问题是它将遍历父级树。如果我有以下内容:只要它的任何祖先(直到主体)悬停,就会显示:host-context(:hover) {...}。action-list在这种情况下,它将始终显示Demo
:host-context(我设法通过在父级和 scss .parent:hover) {...}`演示中设置 css 类来使其工作
它运行良好,但我想避免在父级上设置额外的课程。
问题:
我知道这在纯 CSS 中是不可能的,但是是否有 Angular/scss 魔法语法允许选择直接父级?
就像是:host-context(parent():hover) {...}
我有一个组件计费,其中包括Ng Bootstrap 的ngb-tabset组件。
ngb-tabset具有以下 DOM 元素:
<ngb-tabset _ngcontent-c3="" class="content">
<!-- Tabset links-->
<div class="tab-content">
<div _ngcontent-c3="">
<!-- Content -->
</div>
</div>
</ngb-tabset>
Run Code Online (Sandbox Code Playgroud)
<div class="tab-content">根据所选选项卡动态显示。
在我的中billing.component.scss,以下代码片段不起作用:
.tab-content {
padding-right: 120px;
}
Run Code Online (Sandbox Code Playgroud)
CSS 代码已正确编译,通常可以被导航器看到,但不会对项目产生影响。
但是,如果我将其应用到组件外部的项目上,则代码可以正常工作。
对这种奇怪的行为有什么想法吗?
今天我有这个代码,基本上当我点击详细信息按钮时,它会打开一个mat-menu但不知何故我无法修改菜单的填充或宽度值:
<div id="box-upload" [hidden]="hiddenBoxUpload" *ngIf="filesExist">
<button mat-raised-button color="primary" [matMenuTriggerFor]="listFiles">Details</button>
<mat-menu class="filesList" #listFiles="matMenu">
<div *ngFor="let key of listkey">
<div *ngIf="detailsExist">
<!-- some stuff like mat-progress-bar and span>
</div>
</div>
</mat-menu>
</div>
Run Code Online (Sandbox Code Playgroud)
css代码:
.filesList {
width: auto;
padding: 15px;
}
Run Code Online (Sandbox Code Playgroud)
更改 a 的默认填充和宽度的方法是mat-menu什么?