code make the tooltip shape like this
this is what i tried but no luck
tooltip: {
outside: true,
useHTML: true,
style :{
borderRadius: "10px 10px 10px"
},
pointFormatter: customPointFormatter
}
});
You can enable the useHTML option and style the tooltip by CSS:
.highcharts-tooltip > span {
padding: 10px;
border: 2px solid red;
border-radius: 30px 30px 30px 0;
}
Live demo: http://jsfiddle.net/BlackLabel/wver5hyf/
About border radius: https://www.w3schools.com/cssref/css3_pr_border-radius.asp
Related
I have to change the background-color of the popper(which is calender) in my react-datepicker to black with white font color when I toggle the theme from default(white) to black.
I have tried using popperClassName, but unable to pass in the font color and background color, although my placeholder has accepted the given values and changed its background when theme is toggled. I have to achieve the styles inline (JSS - css in js/jsx) way only ! though I have tried the styling of placeholder externally.
<DatePicker
selected={startDate}
dateFormat={DATE_FORMAT}
showMonthDropdown
showYearDropdown
isClearable
todayButton="Today"
popperClassName={{ color: fontColor, background }}
placeholderText="Click to select date"
className={background === '#303030' ? 'placeholderTable' : ''}
onChange={(date) => {
date = moment(date).format(DATE_FORMAT)
if (date === 'Invalid date') {
// this means that the user deleted the date
// this.setState({ start_date: undefined })
this.handleChange({ start_date: undefined, temp_end_date: undefined })
} else {
// this.setState({ start_date: date })
this.handleChange({
start_date: date,
temp_end_date: moment(date, DATE_FORMAT).add(1, 'year').format(DATE_FORMAT)
})
}
}}
/>
I expect some way to modify the styling for the popper using popperClassName or any other way.
I needed the same thing and this is how I solve it - using css:
.react-datepicker__header {
text-align: center;
background-color: #3e82cf;
border-bottom: 0px;
border-top-left-radius: 0;
border-top-right-radius: 0;
padding-top: 8px;
position: relative;
}
.react-datepicker__today-button {
background: #3e82cf;
border-top: 0px;
cursor: pointer;
text-align: center;
font-weight: bold;
padding: 5px 0;
clear: left;
}
For the calendar area you can use:
.react-datepicker {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 0.8rem;
background-color: #a66;
color: #000;
border: 0px;
border-radius: 0;
display: inline-block;
position: relative;
}
Just create CSS file and import it. It should work. More styles you can find in react-datepicker.css in dist folder.
I am trying to learn how to use draftjs, but i can't figure out how to apply css to the editor itself. I read in the documentation that it is possible to design the content blocks, but i am looking for a way to design the editor.
Draft sets a few class names on the editor that you can use. Here's a (non-comprehensive) list:
.DraftEditor-root
.DraftEditor-editorContainer
.public-DraftEditor-content
.public-DraftEditorPlaceholder-root
.public-DraftEditorPlaceholder-inner
.public-DraftStyleDefault-block
Here's a fiddle showing them. And here's the styles used in the fiddle:
.DraftEditor-root,
.DraftEditor-editorContainer,
.public-DraftEditor-content {
padding: 5px;
margin: 5px;
}
.public-DraftEditorPlaceholder-root {
margin-top: 28px;
margin-left: 25px;
}
.public-DraftEditorPlaceholder-inner {
background: rgba(0, 0, 0, .5);
color: white;
}
.DraftEditor-root {
border: 1px solid black;
}
.public-DraftEditor-content {
border: 1px solid blue;
}
.DraftEditor-editorContainer {
border: 1px solid green;
}
.public-DraftStyleDefault-block {
border: 1px solid red;
margin: 5px 0;
}
Draft will also output some more class names depending on text alignment etc. I'd encourage you to inspect the elements in e.g. Chrome DevTools to see what's available.
Is there a way to add a dropdown button or toggle button to the CellTable or DataGrid?
The documentation only demonstrates using a regular button (ButtonCell).
To add a ToggleButton to a grid, the only way I found is to place the button in another panel (like a FlowPanel) then add this panel in the grid.
To found this type of button, you can visit the showcase of gwt :
http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCustomButton
here my code to have your button in a FlowPanel :
RootLayoutPanel rp = RootLayoutPanel.get();
FlowPanel togglePanel = new FlowPanel();
ToggleButton toggle = new ToggleButton("Coucou");
toggle.setWidth("100px");
togglePanel.add(toggle);
rp.add(togglePanel);
css :
.gwt-ToggleButton-up,
.gwt-ToggleButton-up-hovering,
.gwt-ToggleButton-up-disabled,
.gwt-ToggleButton-down,
.gwt-ToggleButton-down-hovering,
.gwt-ToggleButton-down-disabled {
margin: 0;
text-decoration: none;
background: url("images/hborder.png") repeat-x 0px -27px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.gwt-ToggleButton-up,
.gwt-ToggleButton-up-hovering,
.gwt-ToggleButton-up-disabled {
padding: 3px 5px 3px 5px;
}
.gwt-ToggleButton-up {
border:1px solid #bbb;
border-bottom: 1px solid #a0a0a0;
cursor: pointer;
cursor: hand;
}
.gwt-ToggleButton-up-hovering {
border: 1px solid;
border-color: #939393;
cursor: pointer;
cursor: hand;
}
.gwt-ToggleButton-up-disabled {
border: 1px solid #bbb;
cursor: default;
opacity: .5;
zoom: 1;
filter: alpha(opacity=45);
}
.gwt-ToggleButton-down,
.gwt-ToggleButton-down-hovering,
.gwt-ToggleButton-down-disabled {
padding: 4px 4px 2px 6px;
}
.gwt-ToggleButton-down {
background-position: 0 -513px;
border: 1px inset #666;
cursor: pointer;
cursor: hand;
}
.gwt-ToggleButton-down-hovering {
background-position: 0 -513px;
border: 1px inset;
border-color: #9cf #69e #69e #7af;
cursor: pointer;
cursor: hand;
}
.gwt-ToggleButton-down-disabled {
background-position: 0 -513px;
border: 1px inset #ccc;
cursor: default;
opacity: .5;
zoom: 1;
filter: alpha(opacity=45);
}
It is the basic css i took on the showcase. You should modify it.
Let's say I have a span with a dashed underline:
<span class="underline">Hello, I'm underlined text</span>
.underline {
color: #444;
font-size: 250%;
display:inline-block;
border-bottom: 1px dashed #444;
}
I need a bottom drop shadow for the underline. I assume box-shadow is not the case and the only possible solution is to do it by the means of pseudo elements.
I'm doing this way:
.underline:after {
content:"";
border-bottom: 1px dashed #ff0000;
display: block;
}
This displays the red dashed stroke above the underline but I need to do that below the underline.
How is that possible?
Thanks in advance.
Use position: relative; like this:
.underline:after {
content:"";
border-bottom: 1px dashed #ff0000;
display: block;
position: relative;
top: 2px;
}
I'm not sure why you don't want to use box-shadow (unless its a browser problem) But it would solve the problem.
box-shadow: 0px 10px #888888;
.underline {
color: #444;
font-size: 250%;
box-shadow: 0px 10px 10px #888888;
display:inline-block;
border-bottom: 1px dashed #444;
}
hope this helps
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;
}