AntD css-in-js removing the original props of AntD component - antd

I am trying to customize AntD using css-in-js. I am able to customize the component very successfully but run into an issue during instantiation. The props for the original AntD component are no longer available. This is a big issue. Does anyone have any work arounds to maintain the full props of the original AntD component.
I have used styled-components to style the AntD button , but am not able to retain the props.
const StyledButtonPrimary = styled(Button)
.ant-click-animating-node {
display: none;
}
&& {
border-width: 1px;
border-style: solid;
border-color: ${red500};
margin: 0;
background-color: ${red500};
border-radius: 4px;
color: ${white};
font-family: inherit;
font-size: 14px;
font-style: normal;
font-weight: 600;
line-height: 20px;
text-align: center;
transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
white-space: nowrap;
&:hover {
border-color: ${red700};
background-color: ${red700};
color: ${white};
}
&:active{
border-color: ${red700};
background-color: ${red500};
box-shadow: inset 0 0 0 1px ${red700};
animation-duration: 0s;
animation: none;
animation-fill-mode: none;
}
};
The code below is the styled button but I no longer have access to any of the original AntD Button props.
<StyledButtonPrimary >
Primary Button
</StyledButtonPrimary>

Related

Displaying announcement on all Jenkins pages

Is there a simple way or a plugin to display any custom message on Jenkins pages for all users? I wanted to display important changes or actions directly on Jenkins instead of emailing everyone.
What I mean is to have configurable panel similar to "Jenkins is going to shut down" which I could display and possibly change color. I tried to find plugins for that but found nothing.
Ok, I'll answer my dummy question, maybe someone will look for it later.
There's a plugin for injecting code to page header and footer:
https://wiki.jenkins-ci.org/display/JENKINS/Page+Markup+Plugin
It's not as easy to find as it should be downloaded from creators' page (link in description).
Without an extra plugin: In my case it was simpler as it was enough to add system message (manage jenkins -> configure system -> system message).
You can add CSS to Jenkins\war\css\style.css and use it in system message. I reused "shutdown-msg" which is displayed when jenkins is going to shut down.
#shutdown-msg {
font-weight: bold;
color: white;
background-color: #ef2929;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#yellow-msg {
font-weight: bold;
color: black;
background-color: #eded78;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#green-msg {
font-weight: bold;
color: white;
background-color: #34ba51;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#blue-msg {
font-weight: bold;
color: white;
background-color: #2d72d8;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#grey-msg {
font-weight: bold;
color: white;
background-color: #6b7777;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
<div id="shutdown-msg">Red message</div>
<div id="green-msg">Green message</div>
<div id="yellow-msg">Yellow message</div>
<div id="blue-msg">Blue message</div>
<div id="grey-msg">Grey message</div>

Adding display:inline-block to :before or :after will make webfont disappear

I am using a web font in an :after pseudo class. It shows fine on Desktop Chrome and Android Chrome but on iOS Chrome and Safari (iOS 7.1.2, 9.2.1 and 9.3.1) it disappears unless I comment out both display:inline-block and position:absolute where it then shows the icon immediately to the right with no width.
#font-face {
font-family: 'myFont';
src: url('/channels/myFontFolder/fonts/myFont.eot');
src: url('/channels/myFontFolder/fonts/myFont.eot?#iefix') format('embedded-opentype'),
url('/channels/myFontFolder/fonts/myFont.woff2') format('woff2'),
url('/channels/myFontFolder/fonts/myFont.woff') format('woff'),
url('/channels/myFontFolder/fonts/myFont.ttf') format('truetype'),
url('/channels/myFontFolder/fonts/myFont.svg#my_Font') format('svg');
font-weight: normal;
font-style: normal;
text-rendering: optimizeLegibility;
}
h2 {
padding: 10px;
cursor: pointer;
margin: 0;
border: none;
border-top: 1px solid $table-row-border-colour;
background: none;
font-size: $body-fontSize;
position: relative;
}
h2:after {
content: "\e101";
font-family: myFont;
display: inline-block;
position: absolute;
background: none;
color: green;
font-size: 20px;
width: 20px;
height: 20px;
border: 1px solid red;
right: 0;
top: 0;
}
It's working fine on another element with, as far as I can tell, the same styling applied.
Any help would be appreciated!
Fixed it, needed to add font-weight: bold

Positioning of jQuery UI select dropdown is off by 1px in Chrome only

I have been trying to get my jQuery UI Select dropdown to be aligned on Chrome for some time. Its off by 1px however the list and the parent span.ui-selectmenu-button are both "151px".
All other browsers display it correct.
I've been going through the computer styles one by one but can't find anything.
Its instantiated with the common:
$("#mainlanguage").selectmenu();
And the select box which jQuery uses has basic styling on it. (SCSS)
jquery ui language !select
.mainSearch{
.ui-selectmenu-button {
background:$upsbrown;
outline-style:none!important; // reset
&.ui-state-hover{
border:0;
border-radius:0;
}
border:0;
border-radius:0;
left: 63.3%;
span{
background-color: $upsbrown;
background-position: 93.5% center;
//border-top: 1px solid $navtext;
color: $navtext;
font-size: 11px;
line-height: 18px;
position: relative;
padding-left: 6px;
max-width: 151px;
height: 21px;
z-index: 400;
webkit-appearance: none;
-moz-appearance: none;
appearance: none;
&:focus{
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
}
}
}

HTML input button appears different in iPad

I've created HTML input.
<input type="submit" id="Submitbtn" onclick="javascript:function()" value="Login" name="Submitbtn">
CSS is:
input:hover, input{
background: none repeat scroll 0 0 #1356B4;
border: medium none;
margin-right: 0;
padding: 3px 10px 5px 0;
vertical-align: middle;
border-radius: 5px 5px 5px 5px;
color: #FFFFFF;
cursor: pointer;
display: inline-block;
font: 14px/26px Arial,Helvetica,sans-serif;
height: 26px;
-webkit-transition: all 0.3s ease-in-out 0s;
}
The output in web browsers:
And in iPad:
How to resolve this?
I suppose you must get rid of the webkit appearance on your button by adding in your CSS:
-webkit-appearance: none;

CSS question. How can I get blueprint css to work rails tabnav widget?

I need a quick solution to getting some decent layout working within the tabnav widget display area. I'm already using blueprint css for other aspects of the layout but I don't have enough CSS chops to figure out how to get blueprint containers to display within the tabnav's content area.
The tabnav's content area is <div class="main_tabnav_content" id="main_tabnav_content">
and this is the related css:
.main_tabnav {
color: #000;
border-bottom: 1px solid #ccc;
margin: 13px 0px 0px 0px;
padding: 0px;
z-index: 1;
padding-left: 10px }
.main_tabnav ul {
margin: 0px;
padding: 0px;
}
.main_tabnav li {
display: inline;
overflow: hidden;
list-style-type: none; }
.main_tabnav li span.disabled {
color: #888888;
background: #FAFAFA;
border: 2px solid #DDDDDD;
border-bottom: none;
padding: 2px 5px 0px 5px;
margin: 0;
text-decoration: none;}
.main_tabnav a, main_tabnav a.active {
color: #000000;
background: #EEEEEE;
font-weight: bold;
border: 1px solid #ccc;
padding: 2px 5px 0px 5px;
margin: 0;
text-decoration: none; }
.main_tabnav a.active {
background: #FFFFFF;
border-bottom: 3px solid #FFFFFF; }
.main_tabnav a:hover {
color: #FFFFFF;
background: #CCCCCC; }
.main_tabnav a:visited {
color: #000000; }
.main_tabnav a.active:hover {
background: #FFFFFF;
color: #000000; }
.main_tabnav_content {
background: #FFFFFF;
padding: 20px;
border:1px solid #ccc;
border-top: none;
z-index: 2;
}
I'd like to be able to put some columns inside the main_tabnav_content area like this
<div class="span-5 colborder">
stuff
</div>
<div class="span-5 colborder">
stuff
</div>
<div class="span-5 colborder">
stuff
</div>
At the moment the columns are displayed but the main_tabnav_content box doesn't expand around them. Any suggestions for how to get the blueprint layout nested inside the main_tabnav_content area?
From Blueprint: screen.css:
.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
.last, div.last {margin-right:0;}
.span-1 {width:30px;}
.span-2 {width:70px;}
.span-3 {width:110px;}
.span-4 {width:150px;}
.span-5 {width:190px;}
and also:
div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
I think if you add this <div class="clearfix"></div> before the end of the main_tabnav_content div it should fix the float problem.
Do you have the css for the span-5 & colborder classes? It sounds like it might be a float problem. Basically what's happening is when you add the columns to the main_tabnav_content div, the div doesn't expand, right?

Resources