Ionic 2 overriding sass items - css

I have an Ionic 2 app, that has an ion-searchbar.
<div id="search" class="search-input-keyword">
<ion-searchbar class="ion-searchtext" id="ion-searchtext" [(ngModel)]="searchQueryText" (ionFocus)="focusSearch($event)"
(change)="onChangeText($event)" (ionClear)="onCancelText($event)" (ionInput)="onInputText($event)" placeholder="{{jobType === 0 ? favourite ? 'Market Favourites' : 'Market' : favourite ? 'Postings Favourites' : 'Postings'}}"
debounce="1"></ion-searchbar>
</div>
I would like to change the input text color, and the magnifying glass icon color to #fff.
I have read here, that in order to do so, you need to change the sass variables.
I have tried the following in variables.scss:
$colors: (
primary: #009196,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222
);
$searchbar-ios-input-text-color: #fff;
$searchbar-ios-input-search-icon-color: #fff;
But there is no effect.
However, the following line does have an effect:
$text-color: #000099;
So I guess that the $searchbar-ios-input-text-color: #fff; and $searchbar-ios-input-search-icon-color: #fff; are the issue.
Question
Can anyone please advise how to change the font and icon colours?
Thanks
UPDATE
Here is some more code samples:
css
.toolbar-background-md {
background: linear-gradient(to bottom right, #00a7ad, #004547);
}
.bar-button-default-md {
color: #fff;
}
.searchbar-md .searchbar-input {
background: linear-gradient(to bottom right, #009da3, #018287);
//background-color: #009196;
}
input::-webkit-input-placeholder {
color: red ;
}
input:-moz-placeholder {
color: red ;
}
input:-ms-input-placeholder { /* IE10+ */
color: red ;
}
.toolbar-title-md {
padding: 0 12px;
font-size: 2rem;
font-weight: 500;
color: #fff;
}
.close-filters {
color: #fff;
width: 52px;
font-size: 22px;
background-color: transparent;
box-shadow: none !important;
}
.slide-fade-hide {
transition: 1s all linear;
opacity: 0;
height: 0;
position: absolute;
top: 0;
z-index: -10;
}
.slide-fade-show {
transition: all 1.2s ease-in;
opacity: 1;
height: 2em;
z-index: 1;
}
.list-md {
margin: 0px 0px 0px 0;
}
.scroll-up {
margin-top: 20px;
}
.menu-title {
padding: 1px 95px 1px 10px;
}
.menu-toolbar {
padding: 35px;
}
.menu-content {
position: relative !important;
}
.item-search-wanted {
padding-left: 1px;
}
.item-search-offered {
padding-left: 1px;
}
.job-content-offered {
background-color: white !important;
}
.job-content-wanted {
background-color: white !important;
}
.search-button-star {
background-color: #009196;
}
.search-input-keyword {
width: 125%;
display: flex;
}
.search-input {
width: 125%;
}
.toolbar-content {
display: flex;
}
.extra-search-col {
padding: 0px;
}
ion-col {
padding: 2px;
}
ion-title {
z-index: 11;
}
ion-avatar img {
border-radius: 2.8rem;
max-height: 5.6rem;
max-width: 5.6rem;
}
.small-text-search {
font-size: 75% !important;
color: grey !important;
padding-top: 4px;
}
.small-text-search-desc {
font-size: 85%;
}
.small-text-search-rating {
padding-top: inherit;
padding-left: inherit;
}
.small-text-search-starrating {
padding-top: 2px;
font-size: 100% ! important;
}
.search-category {
float: right;
}
.job-tite {
width: 250px;
}
.job-timestamp {
white-space: nowrap;
}
.search-rating {
float: left;
}
.search-popover-button {
width: 75px;
height: 75px;
}
.button-icon-only ion-icon.search-popover-icon {
font-size: 2.8em;
}
.filter-image {
-webkit-filter : hue-rotate(-30deg) opacity(100%);
filter : hue-rotate(-30deg) opacity(100%);
}
.icon-text {
padding-left: 5px;
padding-bottom: 3px;
}
.icon-text-no {
padding-left: 5px;
}

Related

React JS collapsable elements Pure CSS

How can i make Netflix like Collapsable QNA sectionImage 1 click here
image 2
You don't need JS for this task
body {
margin: 0;
background-color: #000;
font-family: sans-serif;
}
.faq_block {
margin: 30px 0 85px
}
.faq_item {
border-radius: 20px;
padding: 0;
margin-bottom: 10px
}
.faq_item:focus .faq_question,
.faq_item:hover .faq_question {
color: #d5f867
}
.faq_item:focus .faq_question:after,
.faq_item:focus .faq_question:before,
.faq_item:hover .faq_question:after,
.faq_item:hover .faq_question:before {
background: #d5f867
}
.faq_item:before {
display: none
}
.faq_question {
font-weight: 700;
position: relative;
display: block;
font-size: 16px;
color: #fff;
border-radius: 20px;
cursor: pointer
}
.faq_question:after,
.faq_question:before {
content: "";
position: absolute;
background-color: #fff;
z-index: 2
}
.faq_question:after {
right: 17px;
top: 24px;
width: 14px;
height: 2px
}
.faq_question:before {
height: 14px;
width: 2px;
right: 23px;
top: 18px
}
.faq_item[open] .faq_question {
background: #d5f867;
color: #000
}
.bl_ceo .faq_answer ul li:before,
.faq_item[open] .faq_question:after {
background-color: #000
}
.faq_item[open] .faq_question:before {
opacity: 0
}
.faq_item[open] {
background-color: #fff
}
.faq_answer,
.faq_question {
padding: 16px 24px
}
.faq_item[open] .faq_answer,
.faq_item[open] .faq_answer li,
.faq_item[open] .faq_answer p {
color: #000
}
<div class="faq_block">
<details class="faq_item" open="">
<summary class="faq_question">Ask something smart!</summary>
<div class="faq_answer">Answer</div>
</details>
<details class="faq_item">
<summary class="faq_question">Ask something smart!</summary>
<div class="faq_answer">Answer</div>
</details>
</div>

React and Bulma CSS - Not being able to animate modal

I am trying to implement fade-in scale effect in a Bulma CSS modal component with react and scss. It opens (gets active) when I click on a button which turns a state variable this.state.open to true as shown in the code below.
<div
className={
this.state.open
? (this.props.modalClass || 'login-modal') + ' modal is-mobile is-active'
: ' modal is-mobile'
}
id={this.props.modalId || 'login-modal'}
>
<div className={`modal-background ${this.state.open && 'modal-bg-active' }`}></div>
<div className={`modal-content ${this.state.open && 'modal-content-active'}`}>
<div ref={node => (this.wrapperRef = node)} className='modal-content-inner columns is-multiline'>
<div className='column left-content'></div>
<div className='column right-content'>
<div className='text-container'>
<div className='text-inner-container'>
.
.
.
.
I didn't add the entire markup here as in most websites I have seen the classes used for animating are modal,modal-background, and modal-content
The sass code I have written for the modal is:
.modal.login-modal {
z-index: 1000;
.modal-background {
transition: all 3s;
opacity: 0;
}
.modal-content {
background: #fff;
max-width: 840px;
width: 100%;
transform: scale(0.7);
opacity: 0;
transition: all 3s;
}
&.is-active {
visibility: visible;
.modal-background {
opacity: 1;
#include box_shadow_dark();
background-color: rgba(0, 0, 0, 0.85);
}
.modal-content {
transform: scale(1);
opacity: 1;
}
}
// .modal-background.modal-bg-active {
// visibility: visible;
// opacity: 1;
// #include box_shadow_dark();
// background-color: rgba(0, 0, 0, 0.85);
// }
// .modal-content {
// background: #fff;
// max-width: 840px;
// width: 100%;
// transform: scale(0.7);
// opacity: 0;
// transition: all 0.3s;
// }
// .modal-content.modal-content-active {
// transform: scale(1);
// opacity: 1;
// }
//==================================================> EXTRA CODE FOR CONTENT INSIDE MODAL
.left-content {
background-color: #fff;
background-image: url('https:some_url');
#include tablet_only {
display: none;
background-image: none;
}
#include mobile_only {
display: none;
background-image: none;
}
}
.right-content {
background: #fff;
.text-container {
text-align: center;
box-sizing: border-box;
#include mobile_only {
padding: 0;
}
}
.text-inner-container {
padding: 40px;
#include mobile_only {
padding: 30px;
height: auto;
}
}
}
// ==================================== Prompt
.prompt-text {
margin: 15px auto 25px;
font-size: 18px;
text-align: left;
}
// ===================================== Email OTP Fields
.user-input-field {
input {
font-size: 14px;
padding: 12px 15px;
width: 100%;
height: auto;
border-width: 2px;
}
label {
font-size: 13px;
text-align: left;
margin-bottom: 10px;
font-weight: $fontWeightBold;
}
.error-message {
font-size: 13px;
color: red;
text-align: left;
margin: 8px 0px 5px;
font-weight: $fontWeightBold;
}
}
.otp-button {
margin: 15px auto 20px;
padding: 11px 15px;
}
// ====================================== Login Buttons
.login-button {
border-radius: 4px;
padding: 13px 15px;
width: 100%;
font-size: 15px;
cursor: pointer;
height: auto;
font-weight: $fontWeightExtraBold;
#include box_shadow_dark();
}
.facebook-login-js {
display: inline-block;
color: white;
margin: 20px auto 15px;
background-color: $fbBlue;
border: none;
&:hover {
background-color: $fbBlueDark;
}
}
// google login
.google-login-js {
display: inline-block;
color: white;
margin: 0px auto 15px;
background-color: $gplusRed;
border: none;
&:hover {
background-color: $gplusRedDark;
}
}
// ========================================== Seperator
.seperator-text-container {
.seperator-text {
font-weight: $fontWeightBold;
color: #555555;
}
}
.terms-line {
font-size: 10px;
}
//=========================================================> EXTRA CODE FOR CONTENT INSIDE MODAL
}
}
What am I getting wrong here? How should I change the code for it to work? I will surely provide more details if required to understand it. Thank you!
I believe the issue is that bulma modal class has display: none property which can not be animated. Try overwriting it to display: block.
Or you could possibly use something like this https://github.com/postare/bulma-modal-fx

Why is my mobile nav menu drawer pushing the site view downwards when it is opened?

Building a mock website for a family member (placeholder photos). When I open the navigation menu, it pushes the screen down instead of simply opening to the right. Seems to translate the view vertically. How can I get it to just open smoothly to the right without pushing the screen view down?
1a) Screen before opening https://i.stack.imgur.com/UfuZi.png
1b) screen when I click nav menu https://i.stack.imgur.com/yfzS3.png
1c) screen when I scroll up after opening the nav menu https://i.stack.imgur.com/9cI5i.png
Here is the css for the navbar:
NAV HEADER CSS
#media only screen and (max-width: 768px) {
body .site-nav__thumb-menu {
position: absolute;
top: 20px;
bottom: unset;
left: unset;
right: unset;
padding-top: 6px;
}
.site-nav__thumb-menu span.icon-menu-label {
display: none;
}
.site-nav__thumb-menu button svg {
color: #000;
box-shadow: none !important;
}
.site-nav__thumb-menu--inactive {
transform: unset;
}
.slide-nav__wrapper {
transform: translateX(-100%) !important ;
background-color: #fff;
}
.slide-nav__dropdown .slide-nav__sublist-header {
text-decoration: none;
}
.slide-nav__overflow--thumb {
width: 100%;
background-color: #000;
height: 100%;
}
.js-menu--is-open .slide-nav__wrapper {
transform: translateX(0) !important ;
}
.site-nav__thumb-menu button {
background-color: unset !important;
padding: 0;
text-align: left;
width: auto;
min-width: auto;
box-shadow: none !important;
}
nav.slide-nav__wrapper .slide-nav {
padding-bottom: 15px;
}
.slide-nav__overflow--thumb {
left: 0;
right: 0;
bottom: unset;
top: 100px;
position: absolute;
max-height: unset;
}
.header-item.mobile-ac.header-item--icons {
flex: unset;
position: absolute;
right: 10px;
top: 8px;
}
header.site-header.small--hide {
display: block !important;
}
.header-wrapper.header-wrapper--overlay {
transition: .5s ease;
}
.header-wrapper.header-wrapper--overlay.sticky {
position: fixed;
width: 100%;
background-color: #fff;
z-index: 99;
}
.header-wrapper.header-wrapper--overlay.sticky .announcement {
display: none;
}
body .header-wrapper--overlay.sticky + .site-nav__thumb-menu {
position: fixed;
top: -18px;
z-index: 9999;
}
.slide-nav a, .slide-nav button {
color: #000;
text-align: left;
z-index: 9999 !important;
}
.slide-nav .search-modal__wrapper {
border: unset;
}
.slide-nav .search-modal__wrapper {
border: unset;
background: #f1f1f1;
padding: 5px 15px;
}
.search-mobc {
padding: 8px 16px;
display: none;
}
nav.slide-nav__wrapper .slide-nav form button {
float: right;
}
nav.slide-nav__wrapper .slide-nav form button svg {
width: 25px;
height: 40px;
}
.slide-nav__overflow {
transition: .5s ease;
}
.slide-nav__overflow--thumb.sticky {
top: 70px;
position: fixed;
z-index: 9999;
}
.slide-nav__link, .slide-nav__sublist-link {
padding: 16px 20px;
}
.slide-nav__overflow--thumb nav.slide-nav__wrapper {
width: 303px;
height: 100%;
overflow-y: auto;
}
.slide-nav a, .slide-nav button {
color: #000 !important;
}
.slide-nav__overflow--thumb .slide-nav__dropdown {
background-color: #fff;
}
.slide-nav__overflow--thumb.js-menu--is-open {
background-color: #000;
height: 100% !important;
}
.slide-nav__wrapper .slide-nav__item {
border-bottom: 1px solid #ccc;
padding: 7px 0;
}
.site-nav__thumb-menu .site-nav__thumb-cart {
display: none;
}
.account-links-m a.slide-nav__link {
border: 2px solid #000;
width: 140px;;
margin: 0 auto;
font-size: 16px;
font-family: Titling !important;
text-transform: uppercase;
display: none;
}
'Slide out menu css'
.slide-nav__overflow--thumb nav.slide-nav__wrapper {
width: 303px;
height: 100%;
overflow-y: auto;
}
.slide-nav a, .slide-nav button {
color: #000 !important;
}
.slide-nav__overflow--thumb .slide-nav__dropdown {
background-color: #fff;
}
.slide-nav__overflow--thumb.js-menu--is-open {
background-color: #000;
height: 100% !important;
}
.slide-nav__wrapper .slide-nav__item {
border-bottom: 1px solid #ccc;
padding: 7px 0;
}
There are several methods to achieve such a thing. I would recommend to remove. the top attribute which would resolve your problem.
What you are doing is :
and what you want is :
Ensuring both your top menu and your floating menu are top:0; should do the work.

Search on mobile is driving me insane. Mag glass on click search box

I have some code below that i feel like should work just well but it appears to be breaking when i deploy.
All the code here: https://jsfiddle.net/82pmjqgn/
The search blob box just appearing over the content and not hidden. It should be hidden until it's clicked and then appear underneath. Here are some images for more reference. Any help would be greatly appreciated.
// Search
.block-search .amsearch-close,
.block-search .amsearch-loupe {
top: 43px;
}
#media (min-width: 768px) {
.block-search .form .search-autocomplete {
top: 43px;
}
.block-search .amsearch-close,
.block-search .amsearch-loupe {
top: 30%;
}
}
.form .search-autocomplete {
top: 88px;
margin-left: 0;
margin-right: 0;
}
.block-search {
.label {
display: inline-block;
float: none;
}
input {
border-radius: 50px;
height: 40px;
padding-left: 20px;
padding-right: 44px;
}
.control {
border-top: 0;
clear:none;
margin: 0;
padding: 0;
}
.action.search {
background: #5a5a5a;
border-radius: 50px;
height: 34px;
right: 4px;
top: 3px;
width: 34px;
}
.search-autocomplete ul:not(:empty) {
border-color: #c2c2c2;
border-top: 1px solid #c2c2c2;
}
.search-autocomplete ul {
li {
border-color: #c2c2c2;
&:hover {
background-color: #e5e5e5;
}
.amount {
color: #444;
}
}
.selected {
background-color: #e5e5e5;
}
}
}
This is how it currently looks.
How it should look.

Bootstrap 4.1 floating labels

I've found on Google a doc example for Bootstrap 4.1 in which they feature floating labels: getbootstrap.com/docs/4.1/examples/floating-labels/
In that page, however, it is not explained how that can be achieved, and I can't find anything in the docs for v. 4.1. Floating labels are not even listed as a new feature in the ship list.
Does anyone know if floating labels are supported?
It says on the Bootstrap examples page that floating-labels are...
"Experiments - Examples that focus on future-friendly features or
techniques."
Like many of the other examples, there's an additional CSS file used in the example...
Using the floating-labels.css they work as expected in the supported browsers...
https://www.codeply.com/go/X9VbHqzD4B
Best way for me is using transform translate. It is smoother. I have added extra classes to prevent overwriting bootstraps original classes.
body{padding:75px}
.form-group.floating>label {
bottom: 34px;
left: 8px;
position: relative;
background-color: white;
padding: 0px 5px 0px 5px;
font-size: 1.1em;
transition: 0.1s;
pointer-events: none;
font-weight: 500 !important;
transform-origin: bottom left;
}
.form-control.floating:focus~label{
transform: translate(1px,-85%) scale(0.80);
opacity: .8;
color: #005ebf;
}
.form-control.floating:valid~label{
transform-origin: bottom left;
transform: translate(1px,-85%) scale(0.80);
opacity: .8;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group floating">
<input type="text" class="form-control floating" id="usr" required value="">
<label for="usr">Username</label>
</div>
Styles they ware using in that mentioned example site
:root {
--input-padding-x: .75rem;
--input-padding-y: .75rem;
}
html,
body {
height: 100%;
}
body {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-ms-flex-pack: center;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.form-signin {
width: 100%;
max-width: 420px;
padding: 15px;
margin: 0 auto;
}
.form-label-group {
position: relative;
margin-bottom: 1rem;
}
.form-label-group > input,
.form-label-group > label {
padding: var(--input-padding-y) var(--input-padding-x);
}
.form-label-group > label {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
margin-bottom: 0; /* Override default `<label>` margin */
line-height: 1.5;
color: #495057;
border: 1px solid transparent;
border-radius: .25rem;
transition: all .1s ease-in-out;
}
.form-label-group input::-webkit-input-placeholder {
color: transparent;
}
.form-label-group input:-ms-input-placeholder {
color: transparent;
}
.form-label-group input::-ms-input-placeholder {
color: transparent;
}
.form-label-group input::-moz-placeholder {
color: transparent;
}
.form-label-group input::placeholder {
color: transparent;
}
.form-label-group input:not(:placeholder-shown) {
padding-top: calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));
padding-bottom: calc(var(--input-padding-y) / 3);
}
.form-label-group input:not(:placeholder-shown) ~ label {
padding-top: calc(var(--input-padding-y) / 3);
padding-bottom: calc(var(--input-padding-y) / 3);
font-size: 12px;
color: #777;
}
If you really want floating label, see this awesome Bootstrap 4 theme : http://djibe.github.io/material/docs/4.4/material/text-fields/
SCSS version below including support for textarea and excluding styles from IE11, which doesn't support :placeholder-shown.
:root {
--input-padding-x: .75rem;
--input-padding-y: .75rem;
}
.floating-label {
$placeholderColour: $middleGrey;
position: relative;
input, textarea, label {
padding: var(--input-padding-y) var(--input-padding-x);
}
label {
position: absolute;
top: 0;
left: 0;
display: block;
margin-bottom: 0;
line-height: 1.5;
color: $placeholderColour;
border: 1px solid transparent;
border-radius: .25rem;
transition: all .1s ease-in-out;
&:hover {
cursor: text;
}
}
input::-webkit-input-placeholder {
color: transparent;
}
input:-ms-input-placeholder {
color: transparent;
}
input::-ms-input-placeholder {
color: transparent;
}
input::-moz-placeholder {
color: transparent;
}
input::placeholder {
color: transparent;
}
textarea::-webkit-input-placeholder {
color: transparent;
}
textarea:-moz-placeholder {
color: transparent;
}
textarea::-moz-placeholder {
color: transparent;
}
textarea:-ms-input-placeholder {
color: transparent;
}
textarea::placeholder {
color: transparent;
}
input:not(:placeholder-shown),
textarea:not(:placeholder-shown) {
padding-top: calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));
padding-bottom: calc(var(--input-padding-y) / 3);
}
input:not(:placeholder-shown) ~ label,
textarea:not(:placeholder-shown) ~ label {
padding-top: calc(var(--input-padding-y) / 3);
padding-bottom: calc(var(--input-padding-y) / 3);
font-size: 12px;
&:hover {
cursor: default;
}
}
#media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
label {
display: none;
}
textarea:-ms-input-placeholder, input:-ms-input-placeholder {
color: $placeholderColour;
}
textarea::-ms-input-placeholder, input::-ms-input-placeholder {
color: $placeholderColour;
}
}
}
I've created an input floating label for Bootstrap 4 & 5 (not the same look that Bootstrap provides): https://github.com/tkrotoff/bootstrap-floating-label
Here is the online demo: https://codesandbox.io/s/github/tkrotoff/bootstrap-floating-label/tree/codesandbox.io

Resources