I am building a search UI in Angular 8 with the Angular Query Builder module.
The Angular2 query builder module is working correctly. I am customizing the styling for Angular Material following the customization instructions in the documentation. I am using Angular Material and Angular FlexLayout for the styling.
I want to move the "remove" button (the red X) all the way on the RIGHT side of the flex row, to the right of the "value" field.
The flexLayout settings should be showing all of the elements side-by-side in order. However, some sort of style is being applied that places it on the left side despite being the last element in the flex row. I have tried margin-left and other styles but was not able to figure out how to get the X to go all the way to the right side.
Here is the stackblitz:
https://stackblitz.com/edit/angular-aqyt4u?file=src/app/app.component.ts
Here is the snippet of markup for the customization of the remove button:
<!-- Query Builder -->
<query-builder [(ngModel)]='recordsQuerySet' [config]='config'>
<!-- Override remove button -->
<ng-container *queryRemoveButton="let rule; let removeRule=removeRule">
<div fxFlex>
<button type="button" mat-icon-button color="accent" (click)="removeRule(rule)">
<mat-icon>clear</mat-icon>
</button>
</div>
</ng-container>
<!-- etc -->
</query-builder>
You can add a custom class to remove rule button then set its position absolute, some thing like below:
In html file:
<button type="button" mat-icon-button color="accent" (click)="removeRule(rule)" class="remove-rule-btn">
<mat-icon>clear</mat-icon>
</button>
In css/scss file:
.remove-rule-btn{
position: absolute;
right: 5px;
}
Related
I use ngbootstrap for popovers, but I want to override all the default styles it comes with. I have a form that should be displayed as a popover on a button click which has its own styles.
When I use [ngbPopover] it renders an element with the default class of 'popover' applied, instead of overriding each of its properties to align with my expectation, is it possible to remove it all together while rendering on the page and then I could use a custom class with popoverClass property.
<ng-template #popContent><user-form></user-form></ng-template>
<button type="button" class="btn btn-outline-secondary" [ngbPopover]="popContent">
I've got markup and bindings in my popover!
</button>
Looking into the popover source code I see lots of classes nailed without a chance to change them. I suppose the only promising approach would be exclude the css for the popover component from the import.
How to do it depends on how you import the Bootstrap css
I am trying to style an HTML element inside the component from the Fluent UI React library.
What I want to do is put the "On" / "Off" text to the left of the toggle rather than on the left. When I look at my "compiled" code I can see that the component is translated into:
<div>
<label></label>
<div id="target-me">
<button>
<span></span>
</button>
<label></label>
</div>
</div>
I want to add an inline-flex to the target-me div and set flex-flow property to row-reverse in order to get the button element to the right of the label element. The problem is, I can't manage to target the "target-me" div in my code.
How can I achieve this without rewriting a custom component ?
Thanks!
Ok, well I found the answer to my own question so here it is:
<Toggle styles={{ container: { flexFlow: "row-reverse" } }} />
Essentially you can target different parts of the component (root, container, label..) by using the styles property. Use VS Code's Intellisense to find out what elements you can target inside the component and then just give it some regular CSS-in-JS that you want.
I have a table like below with a custom toolbar icon in the top left.
This icon enables/disables the Filter Control.
It is setup like:
<div id="toolbar">
<button id="filterable" type="button" class="btn btn-secondary">
<i class="fas fa-sliders-h"></i>
</button>
</div>
<table>
..
</table>
Is it possible to integrate this custom icon in the other icons on the right side?
E.g. after the pagination switch icon?
Its currently not possible with the bootstrap-table internal functions.
But there is a pull request which allows adding custom buttons.
I've started a blank project with Ionic 3 and the default style is not applying to the buttons.
I'm using a default button with
<button ion-button>Prueba</button>
But I get this
Am I missing something?
UPDATE
Using
<ion-button block color="primary">Acceder</ion-button>
Fix the problem but I notice that is not using full width in the div than contains the button
<div padding>
<ion-button block color="primary">Acceder</ion-button>
</div>
Not sure where is the problem
I am using JSF 2.0
I am able to add Background image to the JSF button but am not able to add icon to the button.
My Requirement is:- JSF button with Background image and a Icon
Following code am using to add background.
<!-- Discard button-->
<h:commandButton action="discard" style="background-image: url('..\\Images\\leftMenuActiveBg.png');width: 150px;height: 30px;color: white;border-color: white;font-size: 15px; " value="#{message.discard}">
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
Can somebody help me in adding a icon to the button too please.
I am updating a image for better Explainanation as what I want to achieve and I what I have achieved till now with above code.
So you want a button with two background images? That's not possible on a single HTML element. The <h:commandButton> generates an single HTML <input type="submit"> element, while you basically need a <button type="submit" class="background"><span class="icon"> instead. You'd need to create a custom component which generates exactly that HTML, or to adopt a 3rd party component librarty which has such a component in its set, such as PrimeFaces. See also the <p:commandButton> showcase.