How to modify wordpress plugin css [closed] - css

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Please check this link: http://jsfiddle.net/Raakh5/hg6au2y2/
<div id="aq-block-1076-2" class="aq-block aq-block-aq_text_block aq_span4 aq-first clearfix">
<div class="cp-calc-widget" data-calcid="2424" data-anchor="2">
<form class="widgetForm cleanslate" id="widgetForm" method="post"
style="width: 260px !important; background-color: #378CAF !important;
border-color: #006395 !important; color: #ffffff !important; font-size: 16px !important;">
<input name="numFields" type="hidden" value="1">
<input name="calcId" type="hidden" value="2424">
<input name="answer_format" type="hidden" value="function">
<div class="widgetTitle">Water Intake Calculator</div>
<hr style="color: #006395 !important; background-color: #006395 !important;">
<div class="form_area"><div class="field">Weight:<div class="buffer">
<input class="inputArea" name="input0" value="">
</div>
</div>
<input type="submit" id="widgetSubmit" class="widgetSubmit calc_button" value="Calculate"
style="color: #ffffff !important; background-image: -moz-linear-gradient(top, #378CAF, #006395) !important;
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #378CAF),color-stop(1, #006395)) !important;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#378CAF, endColorStr=#006395, GradientType=0 );
border-color: #006395 !important;">
</div>
<div class="answer_area hidden_class">
<div class="loading">loading...</div>
<div class="actual_answer hidden_class">
<span class="pre_answer"></span>
<div class="answer">
<span class="return_answer"></span></div>
</div>
<div>
<input type="button" id="backButton" class="backButton calc_button" value="< back"
style="color: #ffffff !important; background-image: -moz-linear-gradient(top, #378CAF, #006395) !important;
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #378CAF),color-stop(1, #006395)) !important;
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=#378CAF, endColorStr=#006395, GradientType=0 );
border-color: #006395 !important;">
</div>
</div>
</div>
</form>
</div>
I have embedded wordpress plugin pro-calculator and want to change its:
Background Color
Button Color
Want to write lbs in Front of "Weight" as "Weight (lbs)"
Please advise

You have a couple of options.
1) (Recommended) Use a different plugin that doesn't put inline styles directly on html elements. Then you can style it with CSS and not have to battle inline styling.
2) Override the output of their display function. If they are using actions/hooks you should be able to de-register their function that displays the html on the page, copy it into your own function, and register your function in place of theirs. This would be nice becasue you could change output such as adding (lbs) to the weight input. Here is an example of doing the action overrides.
The third and worst option is editing the plugin code directly but you will lose all of your changes if a site admin ever does the one-click plugin update in the wp-admin. This is obviously a unwanted scenario.

Okay I guess I found out a way, which is possible but a hack. Since ids are all same and you do use jQuery, it is easy to change it using .css(). Give this a try, which you are supposed to put in the CSS:
(function ($) {
setTimeout(function () {
$(function () {
$("#widgetForm").css({
"border-width": "2px",
"background-color": "#ccc",
"border-color": "#99f"
});
});
}, 1250);
})(jQuery);
Also, let's give a simple setTimeout() so that it takes the time to load the plugin. :)
Fiddle: http://jsfiddle.net/praveenscience/2fqk93av/

Related

Bootstrap button outline

I have a problem with a button.
I want to fix that gray effect on click but i don't know how to do so.
<div class="col-lg-7 col-sm-5 col-md-11">
<form class="navbar-form">
<div class="input-group">
<input type="text" class="form-control" placeholder="Look for something cool">
<div class="input-group-append">
<button class="btn btn-outline-secondary"><i class="fas fa-search"></i></button>
</div>
add this to your css
button:focus {
box-shadow: none !important;
outline: none !important;
}
PS: it's not recommended to remove it, as it is meant to make the user experience more accessible for people with disabilities or people who are not using touch/mouse as control (for example, if you're trying to navigate to that button using TAB button it will be very hard)
Do you mean the hover? if so create some custom CSS that states:
.btn-outline-secondary:hover{
// YOUR STYLES HERE (the grey comes from the background so...)
background: red (or whatever you want)
}
I think you are referring to the outline of the button when clicked/focused.
here is the CSS you might consider:
.btn:focus {
outline: 0;
}
Here is the detailed answer to your question. Remove blue border from css custom-styled button in Chrome

Angular UI Bootstrap datepicker half date coloring

I have a question that is similar to this question on jQuery datepicker show half day blocked
I need to style a date field diagonally.
For example, in booking calendars when people are leaving in the morning or coming at the afternoon.
Well the solution in the problem you linked to was to use a linear gradient like this:
.css-class-to-highlight a {
background: linear-gradient(red 50%, green 50%);
}
I'm not sure what it buys you, but you can use a linear-gradient() and specify the angle in degrees like this:
div[datepicker] table td button {
background: linear-gradient(-45deg, #4AD34A 50%, #009EFF 50%) !important;
}
You've asked for a CSS only solution that will only affect the visual presentation of the data. If that's what you want you're all set. If you wanted to take different actions based each quadrant, you'd need a more sophisticated setup.
Demo in Stack Snippets
var app = angular.module('ui.bootstrap.module', ['ui.bootstrap']);
app.controller('ui.bootstrap.ctrl', function ($scope) {
$scope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened = true;
};
});
div[datepicker] table td button {
background: linear-gradient(-45deg, #4AD34A 50%, #009EFF 50%) !important;
}
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.css" rel="stylesheet">
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.0/ui-bootstrap-tpls.js"></script>
<div ng-app="ui.bootstrap.module" >
<div ng-controller="ui.bootstrap.ctrl">
<div class="row">
<div class="col-xs-6">
<p class="input-group">
<input type="text" class="form-control"
datepicker-popup
ng-model="dt"
is-open="opened"
ng-required="true"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default"
ng-click="open($event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
</div>
</div>
</div>
</div>

How can I build a CSS selector that will highlight/outline a focused tab, while not effecting other non-tab widgets?

PROBLEM:
The user is able to utilize the "tab" key to navigate thru the page and land on the "tabs" panel. However, when they initially land on the "tabs" panel - there is no visual indication (outline/highlight/etc) that they are there.
-As a result, they think their tab key (or the tab panel) is not working correctly.
Notes:
My suspicion is that this new behavior is due to a CSS change that occurred when upgrading from 1.8.x to 1.10.x - But, of course, I'm not sure.
I've tried various css entries to cause the focused tab to visually outline/highlight...-So far, one that appears to have a visual effect on the tab is this selector:
.ui-widget :focus
{
border-style: inset !important;
border-width: 5px !important;
}
...But, this selector is too broad and impacts other widgets on the page that are outside of the tabs() DIV. --I only want to "highlight" focused tabs within the "tabs" DIV.
Question:
How can I build a CSS selector that will highlight/outline a focused tab, while not effecting other non-tab widgets?
(Thanks for your help)
jquery script
$(document).ready(function() {
$('#tabdiv').tabs(); //<== tabs
$( "input[type=submit], a, button" ).button().click(function( event ) {event.preventDefault();});
$( "#datepicker" ).datepicker();
});
css
.ui-widget :focus
{
border-style: inset !important;
border-width: 3px !important;
}
HTML snippet
<div>
<h1>body-A</h1>
<div id="tabdiv">
<ul>
<li>TabA</li>
<li>TabB</li>
<li>TabC</li>
<li>TabD</li>
</ul>
<div id="tabA">
<div>
<span>tabA stuff</span>
</div>
</div>
<div id="tabB">
<div>
<span>tabB stuff</span>
</div>
</div>
<div id="tabC">
<div>
<span>tabC stuff</span>
</div>
</div>
<div id="tabD">
<div>
<span>tabD stuff</span>
</div>
</div>
</div>
<div>
<p>Date: <input type="text" id="datepicker" /></p>
<button>A button element</button>
<input type="submit" value="A submit button" />
An anchor
</div>
</div>
You could use the following selector
[id~=tab]:focus
It appears that to following works...
.ui-widget#tabdiv :focus
{
border-style: inset !important;
border-width: 3px !important;
}
Thanks!

Jquery-mobile css disturbing my customized css for button

I am using jquery.mobile-1.1.0 for a PhoneGap application. I am getting issue in button css. Jquery has its own button styling but I don't want to use that and want have my own button css. I am also using few jQuery components like tabs, form-search that use jQuery-mobile css so I have to include it in my application.
Here is my html code:
<div data-role="content">
<div class="signup">
<form action="#" id="loginForm">
<fieldset>
<ul>
<li class="first">
<label><span>Email*</span></label>
<input name="loginemail" type="text" id="loginemail" class="input" placeholder="Enter Full Name" />
</li>
<li>
<label><span>Password*</span></label>
<input name="loginpassword" id="loginpassword" type="text" class="input" placeholder="Pick A Password" />
</li>
<li>
<input name="" type="submit" id="loginSubmit" class="button" value="Login" />
</li>
</ul>
</fieldset>
</form>
</div> <!-- signup- div -->
</div><!-- - content -->
</div> <!-- end login page -->
Source while doing inspect element in Firebug jQuery creates an outer layer against that button that eventually disturb my whole button css.
<li><div aria-disabled="false" class="ui-btn ui-shadow ui-btn-corner-all
ui-fullsize ui-btn-block ui-btn-up-c" data-mini="false" data-inline="false"
data-theme="c" data-iconpos="" data-icon="" data-wrapperels="span"
data-iconshadow="true" data-shadow="true" data-corners="true">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text">Login</span>
</span>
<input aria-disabled="false" name="" id="loginSubmit"
class="button ui-btn-hidden" value="Login" type="submit"></div></li>
Here is my customized button class for css
.button{ width:100% !important; height:69px !important;
float:left !important;
font-size:24px !important;
font-family:"MyriadPro-BoldCond_0",Arial, Helvetica, sans-serif !important;
color:#FFFFFF !important; text-align:center;
background:#ca2c00 !important; border:none !important;
background:-moz-linear-gradient(#ca2c00, #7a1a00) !important;
background: -webkit-gradient(linear, left top, left bottom, from(#ca2c00), to(#7a1a00)) !important;
-pie-background: linear-gradient(#ca2c00, #7a1a00) !important;
background: -o-linear-gradient(#ca2c00, #7a1a00) !important;
-moz-border-radius:0 0 7px 7px !important;
-webkit-border-radius:0 0 7px 7px !important;
border-radius:0 0 7px 7px !important; behavior: url(PIE.htc) !important;
position:relative !important;
cursor:pointer !important;}
Please help. How can I stop jQuery from creating an outer shell around the button and allow it to pick my customized css. Thanks
In jquery mobile ,Input-based buttons and button elements are auto-enhanced, no data-role required. So you have two options to overcome this issue.
Edit the jquery mobile theme, or rather create a customized theme using Theme Roller. You can find the themeroller tool here.
Second option is to set data-role of the input button to none. Ex <input type="button" data-role="none" id="btnId" class="button">.
Hope it helped you.
-- MEJO
The .button class is used by jQuery Mobile, try to use another class name.

Bootstrap navbar search icon

The bootstrap examples for the navbar search form have just a text box.
I'd like to be able to add a search icon at the beginning, like Twitter does on their search box. How can I do this with bootstrap?
Here's what I've tried so far but it's failing:
http://jsfiddle.net/C4ZY3/3/
Here's how to use the :before pseudo selector and glyphicons for Bootstrap 2.3.2 instead of a background image on the input.
Here's a couple of simple examples: http://jsfiddle.net/qdGZy/
<style type="text/css">
input.search-query {
padding-left:26px;
}
form.form-search {
position: relative;
}
form.form-search:before {
content:'';
display: block;
width: 14px;
height: 14px;
background-image: url(http://getbootstrap.com/2.3.2/assets/img/glyphicons-halflings.png);
background-position: -48px 0;
position: absolute;
top:8px;
left:8px;
opacity: .5;
z-index: 1000;
}
</style>
<form class="form-search form-inline">
<input type="text" class="search-query" placeholder="Search..." />
</form>
Update For Bootstrap 3.0.0
Here's an updated fiddle for bootstrap 3.0: http://jsfiddle.net/66Ynx/
One of the way to do it is to add left padding to the field and add background image for the field.
See example: http://jsfiddle.net/hYAEQ/
It's not exact way twitter.com do it, they used absolute position element above search field because they have all images in the single sprite, and can't easily use them as backgrounds, but it should do.
I used inline image for a background to make it easier to post it to jsfiddle, but feel free to use normal links to images here.
EDIT: The way to do it using bootstrap sprite and additional container for icon
http://jsfiddle.net/hYAEQ/2/
EDIT 2:
Fix for white bootstrap theme: http://jsfiddle.net/hYAEQ/273/
EDIT 3:
If you are using navbar-inverse (black navbar) you will want this minor tweak: http://jsfiddle.net/hYAEQ/410/
.navbar-search .search-query {
padding-left: 29px !important;
}
Play this fiddle, I put some rosin on the bow for you:
http://jsfiddle.net/pYRbm/
.fornav {
position:relative;
margin-left:-22px;
top:-3px;
z-index:2;
}
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<form class="navbar-search">
<div class="input-append">
<input type="text" class="search-query span2" placeholder="Search…"><span class="fornav"><i class="icon-search"></i></span>
</div>
</form>
</div>
</div>
</div>
You can also not touch the css at all by using prepending form inputs like so
<form class="navbar-search">
<div class="input-prepend">
<span class="add-on"><i class="icon-search"></i></span><input name="url" type="text" class="span2" placeholder="Page Url">
</div>
</form>
Note that whitespace between </span> and <input> will create a gap between the icon and the text box.
In bootstrap 3.x.x
<div class="input-group">
<input type="text" class="form-control" id="search">
<span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
</div>
The new version 2.1.1 fixes the problem. It doesn't handle the case of the 15 pixel radius, so I went ahead and styled it accordingly. I also added navbar-inverse for fun.
A couple of caveats. The CSS can be better optimized, but recently I've been spoiled by less. Finally, there's an ever so slight, barely visible, left border to the left of the magnifying glass. I don't know exactly what's causing it, but it is likely the box shadow.
Please feel free to fork and improve.
http://jsfiddle.net/joelrodgers/hYAEQ/333/
For those using Rails, my solution is not the most beautiful but works.
<%= form_tag PATH_TO_MODEL, :method => 'get', :class => "navbar-search" do %>
<%= text_field_tag :search, params[:search], :class => "search-query",
:style => "padding-left:29px" %>
<div class="icon-search" style="position:absolute;top:7px;left:11px;"></div>
<% end %>
Bit late to the party on this one ...
I used the following to achieve the search input as an icon
<div class="input-append">
<input id="appendedInputButton" class="span6" type="text" placeholder="Search...">
<button class="btn" type="button"><i class="icon-search"></i></button>
</div>
You should change your approach. Use span.search-query as an overlay - here you have the most important things:
.navbar-search { position: relative } /* wrapper */
.search-query { position: absolute; left: 0; top: 0; z-index: 2; width: x } /* icon */
.span3 { position: relative; z-index: 1; padding-left: x } /* input */

Resources