In ionic new version from 4 we can remove border of tabs by adding
ion-tab-bar {
border: 0;
margin-top: -1px;
}
Add scss
:host {
ion-tab-bar {
border: 0;
margin-top: -1px;
}
}
Related
I've been trying to figure out how to remove the highlight color from my mobile menu. In the image below you can see the white highlight around home. The highlight moves to whatever is clicked on. When a new page opens, the highlight is just a white line below the 'close' X in the top right.
https://i.stack.imgur.com/CT4Zd.png
https://i.stack.imgur.com/IYp2Q.png
I've been trying to set the border to 'none' for links on the menu or just to turn the border color to 006680 to match the background of the menu. Nothing seems to work.
.sidr-class-dropdown-menu li a, .sidr-class-fs-dropdown-menu li a
{
padding: 7px 20px;
font-family: "Alegreya SC";
font-size: 20px;
font-weight: 500;
text-align: center;
line-height: 1.5;
height: 100%;
border: none;
border-color: #006680;
}
.sidr-class-dropdown-menu li a::selection, .sidr-class-fs-
dropdown-menu li a::selection {
border: none;
border-color: #006680;
}
.sidr-class-dropdown-menu li a:active, .sidr-class-fs-dropdown-menu
li a:active {
border: none;
border-color: #006680;
}
.sidr-class-menu-link {
border: none;
border-color: #006680;
}
I'm trying to remove top, right and left borders for text input fields, using bootstrap 3. My selector is:
input[type="text"] {
border-top: 0;
border-right: 0;
border-left: 0;
}
It's still showing (in chrome) a slight thin line.
I'm not sure how to get that ghost line to disappear
You did remove the border from top left and right. That "ghost line" you see, it is the inset shadow. You can remove that as well
input[type="text"] {
border-top: 0;
border-right: 0;
border-left: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
and if you want to remove that when a user "focuses" the field
input[type="text"]:focus {
-webkit-box-shadow: none;
box-shadow: none;
}
Write this in your css file.
input {
border: none;
}
If it is not working please share your html code.
If your form uses tags <fieldset>, try to remove their borders too:
fieldset {
border: 0;
}
Can we change icon from Ionic ion-checkbox ?
Can we use http://ionicons.com/ ?
for now, here my code :
<ion-view>
<ion-content class="has-header">
<ion-list>
<ion-checkbox class="item-checkbox-right">item 1</ion-checkbox>
<ion-checkbox class="item-checkbox-right">item 2</ion-checkbox>
<ion-checkbox class="item-checkbox-right">item 3</ion-checkbox>
Thank you
No, You can't.
As you can see that it is a default icon Set for ion-checkbox. You can only change the css like styling it by change color, background, margin, padding etc.
Alternatively you can change you checkbox to <input type="checkbox> and style it as in ionic.
UPADTED
I have opted pure css solution.
css
input[type="checkbox"] {
display: none;
}
input[type=checkbox]:not(old) + label {
display: inline-block;
padding: 1px;
line-height: 30px;
background:url(https://cdn0.iconfinder.com/data/icons/woocons1/Checkbox%20Empty.png) left top no-repeat;
background-size: 25px 25px;
}
input[type=checkbox]:checked + label { background:url(https://cdn0.iconfinder.com/data/icons/woocons1/Checkbox%20Full.png) left top no-repeat;
background-size: 25px 25px;
}
html
<input type="checkbox" id="1">
<label for="1">Sector 1</label>
Big Thank You #Atula, we cannot change icon from ion-checkbox,
So, with css Ionic icon, here you are my solution (if you have better ? you're welcome) :
Please, help
html
<ion-view>
<ion-content class="has-header">
<div id="frameCheckboxHome" data-ng-click="homeCtrl.toggle('Item1')">
<label>Item1</label><!-- white space
--><div id="checkboxHome"><i class="icon ion-heart {{homeCtrl.homeTab['Item1']}}"></i></div>
</div>
<div id="frameCheckboxHome" data-ng-click="homeCtrl.toggle('Item2')">
<label>Item2</label><!-- white space
--><div id="checkboxHome"><i class="icon ion-heart {{homeCtrl.homeTab['Item2']}}"></i></div>
</div>
</ion-content>
</ion-view>
scss
#frameCheckboxHome{
width: 100%;
border-bottom: lightgrey solid 1px;
padding-top: 10px;
padding-bottom: 10px;
label{
width: 80%;
margin: 0px;
vertical-align: middle;
padding-left: 10px;
}
div{
width: 20%;
margin: 0px;
vertical-align: middle;
display: inline-block;
text-align: center;
}
div i{
color: lightgrey;
font-size: 36px;
}
.selected { color: orange; }
}
js with angular meteor 1.3 Ionic
class Home {
constructor($scope, $reactive) {
'ngInject';
$reactive(this).attach($scope);
this.myTab = [];
}
toggle(param){
!this.myTab[param] ? this.myTab[param] = "selected" : this.myTab[param] = "";
}
}
...
.component(name, {
templateUrl: `imports/ui/components/${name}/${template}.html`,
controllerAs: 'homeCtrl',
controller: Home
})
...
Well, you can change the icon for ion-checkbox with a little tweak ;).
Approach
remove the default icon
add a HTML element whose class changes on the ng-model value of ion-checkbox
Code
HTML:
<ion-checkbox class="custom-checkbox" ng-model="itemChecked">
I'm a checkbox
<i class="icon"
ng-class="{'true':'ion-ios-circle-filled', 'false':'ion-ios-circle-outline'}[!!itemChecked]">
</i>
</ion-checkbox>
CSS:
// positioning custom icon properly
.custom-checkbox .icon {
font-size: 20px;
position: absolute;
left: 16px;
}
// hiding default icon
.custom-checkbox i.checkbox-icon {
display: none;
}
Here's the CodePen Demo for it.
My solution:
.checkbox-md {
.checkbox-icon:before {
display: inline-block;
content: "\f219";
font-family: "Ionicons";
font-size: 1.9em;
color: $primary;
}
.checkbox-icon {
background-color: transparent;
border: none;
height: 32px;
&.checkbox-checked:before {
display: inline-block;
content: "\f147";
font-family: "Ionicons";
font-size: 1.9em;
color: $primary;
}
.checkbox-inner {
border: none;
}
}
}
I'm wondering how one might go about styling an Ext JS checkbox to look like a toggle button.
I'm trying to avoid digging into custom themes for this.
Well, I figured it out before I finished posting the question. Turns out it's not too hard...
JS:
{
xtype: 'checkboxfield',
fieldCls: 'toggleBox',
inputAttrTpl: 'value="Button text here"'
}
Custom CSS:
.toggleBox {
background: transparent;
margin: 0;
width: auto;
padding: 0 7px;
height: 25px;
border: 1px solid #aaa;
color: #999;
}
.x-form-cb-checked .toggleBox {
border: 1px solid #393;
background: #7d7;
color: #fff;
}
I have a GWT application with two TabPanels.
The TabPanel generates css-classes that has the prefix gwt-TabPanel.
Is there any way to change this prefix for one of the tables? I want to be able to style the two TabPanels independently.
To solve this I did:
Using setStylePrimaryName(String); This will change the prefix for the CSS class names that the TabPanel and TabBar uses.
tabPanel.getTabBar().setStylePrimaryName("myTabBar");
tabPanel.setStylePrimaryName("myTabPanel");
In your CSS file your add something like this:
.myTabBar {
}
.myTabBar .gwt-TabBarFirst {
width: 5px; /* first tab distance from the left */
}
.myTabBar .gwt-TabBarRest {
}
.myTabBar .gwt-TabBarItem {
margin-left: 6px;
padding: 3px 6px 3px 6px;
cursor: pointer;
cursor: hand;
color: black;
font-weight: bold;
text-align: center;
background: #3A3A3A;
}
.myTabBar .gwt-TabBarItem-selected {
cursor: default;
/* background: black; */
}
.myTabBar .gwt-TabBarItem-disabled {
cursor: default;
color: red;
}
.myTabPanel {
}
.myTapPanel .myTabPanelBottom {
border-width: 0px;
overflow: hidden;
padding: 6px;
}
For the second TabPanel you set a different with setStylePrimaryName() on both the TabPanel and the TabBar. Then you add a new section to the CSS file with the second primary name.
You can use the methods setStyleName() and addStyleName() to set or add css styles to GWT UI objects.