how can I hide tail triangle on popup - leaflet

image http://pasteio.com/m26f642c81452a5bf67cfc5f0b0f2390c
I'm using leaflet to render the mapbox map. There is small triangle on the top of marker; how can I hide it?

For others coming across this post who may be struggling with the tooltip triangle, or even the background css of the tooltip, I have put together my research in one place and found the various ways to affect the triangle and the background of the tooltips and the popups!
If you have a POPUP bound to a marker, .leaflet-popup-tip controls the triangle. Here I am hiding it:
.leaflet-popup-tip {
background: rgba(0, 0, 0, 0) !important;
box-shadow: none !important;
}
If you have a TOOLTIP you have added to the map, you can control the tooltip's triangle with this magical css:
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
border: none !important;
}
More styling:
POPUP: You can also control the popup's css as well by targeting .leaflet-popup-content-wrapper. Here I am completely removing all traces of the background/border/box of the popup & enlarging the font:
.leaflet-popup-content-wrapper {
background: rgba(0, 0, 0, 0) !important;
border: none !important;
font-size: 20px;
box-shadow: none !important;
}
TOOLTIP: You can add a class name to a tooltip when you create it such as {className: 'popup'}, and then use that to style the tooltip:
.popup {
background: rgba(0, 0, 0, 0) !important;
border: none !important;
font-size: 20px;
box-shadow: none !important;
}
To see how to add tooltips and popups to the map, and how all of this works together, here is a working example with commenting throughout:
https://repl.it/#MeowMeow/NeighboringConventionalPhp
Hope this is helpful to someone! :)

This triangle is controlled by the .leaflet-popup-tip class in css. If you are using standard Leaflet, you should be able to hide the tip by adding the following to your css (after leaflet.css is loaded):
.leaflet-popup-tip {
width: 0px;
height: 0px;
}
Mapbox actually creates the tip in a slightly different way from standard Leaflet, by styling the element border rather than the element content, so if you are using mapbox.js, you should be able to do it by adding the following (after mapbox.css is loaded):
.leaflet-popup-tip {
border: 0px;
}

Related

Ion Refresher Background color wont change ionic

I'm using an ionic refresher to refresh content on a page in my application. However, when I pull up the ion-refresher, background does not get fully set to the color I want.
This is a CSS class I'm applying to the ion-refresher:
ion-refresher {
background-color: #dedede;
}
ion-refresher-content {
background-color: #dedede;
}
And this it what the result looks like:
How do I remove the white gap between the ion refresher and the main content?
On Ionic 4, this CSS worked for me:
ion-refresher-content {
padding-bottom: 200px;
background-color: yellow;
.refresher-pulling {
position: fixed;
top: 50px;
}
}
The padding-bottom: 200px; fills up the space to show the yellow color, but it also introduces a new issue. The refresher arrow disappears! In order to keep the arrow in place and make it function normally, the .refresher-pulling and its corresponding styles are added. This way, now the app background color shows without any white gaps and also the spinner stays in place.
Hope this helps someone.
When you pull up, one div was been created called fixed-content
For remove the gap just add .fixed-content in your .scss
Example:
.fixed-content{
background:#dedede;
}
This is what got it working for me.
ion-refresher-content {
padding-bottom: 100px;
background-color: #dedede;
}
#devner's solution is not working correctly with iPhone X and kind (i.e. devices with safe-area-inset).
Proper solution (Ionic 4):
ion-refresher-content {
position: relative;
padding-bottom: 200px;
background-color: var(--base-background-color-body);
.refresher-pulling, .refresher-refreshing {
position: relative;
top: 30px;
}
}
Appendix: best UX on my opinion can be achieved with next HTML:
<ion-refresher slot="fixed" pullFactor="0.5" (ionRefresh)="onPullToRefresh($event)">
<ion-refresher-content
pullingIcon="refresh"
refreshingSpinner="crescent"
></ion-refresher-content>
</ion-refresher>

Pseudo elements disappear on mobile

I’m using the pseudo elements ::before and ::after to underline text on my about page: http://www.alexanderschlosser.de/wordpress/about.
For some weird reason everything works great on desktop, but no matter what mobile browser I use on my iPhone it won’t show the underlines. Or they actually show up for a split second, but disappear afterwards.
It’s even weirder as I use the exact same CSS styling for the main navigation and it works perfectly fine for those links on all devices.
Any idea what the problem might be?
_
Here’s the CSS
.linkBio::before {
content: "";
position: absolute !important;
z-index: -1 !important;
width: 100%;
height: 1px;
bottom: -1px;
left: 0;
background-color: #252526;
}
/*CREATE COLORED BACKGROUND AND HIDE IT*/
.linkBio::after {
content: "";
position: absolute !important;
z-index: -2 !important;
width: 100%;
height: 100%;
bottom: 0px;
left: 0;
background-color: #DFFAD6;
visibility: hidden;
/*opacity: 0;
-webkit-transition: all 0.05s ease-in-out 0s;
transition: all 0.05s ease-in-out 0s;*/
}
/*SHOW COLORED BACKGROUND ON HOVER*/
.linkBio:hover::after {
visibility: visible;
/*opacity: 1;*/
}
It's the z-index you've set for them. Change them to 0 and it will work as expected.

Increase Text Editor Width in Jupyter [duplicate]

I would like to increase the width of the ipython notebook in my browser. I have a high-resolution screen, and I would like to expand the cell width/size to make use of this extra space.
Thanks!
EDIT / ANSWER : 5/2017
I now use jupyterthemes: https://github.com/dunovank/jupyter-themes
and this command:
jt -t oceans16 -f roboto -fs 12 -cellw 100%
which sets the width to 100% with a nice theme.
If you don't want to change your default settings, and you only want to change the width of the current notebook you're working on, you can enter the following into a cell:
from IPython.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
That div.cell solution didn't actually work on my IPython, however luckily someone suggested a working solution for new IPythons:
Create a file ~/.ipython/profile_default/static/custom/custom.css (iPython) or ~/.jupyter/custom/custom.css (Jupyter) with content
.container { width:100% !important; }
Then restart iPython/Jupyter notebooks. Note that this will affect all notebooks.
To get this to work with jupyter (version 4.0.6) I created ~/.jupyter/custom/custom.css containing:
/* Make the notebook cells take almost all available width */
.container {
width: 99% !important;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode*/
div.cell.selected {
border-left-width: 1px !important;
}
It's time to use jupyterlab
Finally, a much-needed upgrade has come to notebooks. Jupyterlab uses the full width of your window like any other full-fledged native IDE by default.
All you have to do is:
pip install jupyterlab
# if you use conda
conda install -c conda-forge jupyterlab
# to run
jupyter lab # instead of jupyter notebook
Here is a screenshot from blog.Jupyter.org
What I do usually after new installation is to modify the main css file where all visual styles are stored. I use Miniconda but location is similar with others C:\Miniconda3\Lib\site-packages\notebook\static\style\style.min.css
With some screens these resolutions are different and more than 1. To be on the safe side I change all to 98% so if I disconnect from my external screens on my laptop I still have 98% screen width.
Then just replace 1140px with 98% of the screen width.
#media (min-width: 1200px) {
.container {
width: 1140px;
}
}
After editing
#media (min-width: 1200px) {
.container {
width: 98%;
}
}
Save and restart your notebook
Update
Recently had to wider Jupyter cells on an environment it is installed, which led me to come back here and remind myself.
If you need to do it in virtual env you installed jupyter on. You can find the css file in this subdir
env/lib/python3.6/site-packages/notebook/static/style/stye.min.css
This is the code I ended up using. It stretches input & output cells to the left and right. Note that the input/output number indication will be gone:
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
display(HTML("<style>.output_result { max-width:100% !important; }</style>"))
display(HTML("<style>.prompt { display:none !important; }</style>"))
You can set the CSS of a notebook by calling a stylesheet from any cell. As an example, take a look at the 12 Steps to Navier Stokes course.
In particular, creating a file containing
<style>
div.cell{
width:100%;
margin-left:1%;
margin-right:auto;
}
</style>
should give you a starting point. However, it may be necessary to also adjust e.g div.text_cell_render to deal with markdown as well as code cells.
If that file is custom.css then add a cell containing:
from IPython.core.display import HTML
def css_styling():
styles = open("custom.css", "r").read()
return HTML(styles)
css_styling()
This will apply all the stylings, and, in particular, change the cell width.
(As of 2018, I would advise trying out JupyterHub/JupyterLab. It uses the full width of the monitor. If this is not an option, maybe since you are using one of the cloud-based Jupyter-as-a-service providers, keep reading)
(Stylish is accused of stealing user data, I have moved on to using Stylus plugin instead)
I recommend using Stylish Browser Plugin. This way you can override css for all notebooks, without adding any code to notebooks.
We don't like to change configuration in .ipython/profile_default, since we are running a shared Jupyter server for the whole team and width is a user preference.
I made a style specifically for vertically-oriented high-res screens, that makes cells wider and adds a bit of empty-space in the bottom, so you can position the last cell in the centre of the screen.
https://userstyles.org/styles/131230/jupyter-wide
You can, of course, modify my css to your liking, if you have a different layout, or you don't want extra empty-space in the end.
Last but not least, Stylish is a great tool to have in your toolset, since you can easily customise other sites/tools to your liking (e.g. Jira, Podio, Slack, etc.)
#media (min-width: 1140px) {
.container {
width: 1130px;
}
}
.end_space {
height: 800px;
}
For Chrome users, I recommend Stylebot, which will let you override any CSS on any page, also let you search and install other share custom CSS. However, for our purpose we don't need any advance theme. Open Stylebot, change to Edit CSS. Jupyter captures some keystrokes, so you will not be able to type the code below in. Just copy and paste, or just your editor:
#notebook-container.container {
width: 90%;
}
Change the width as you like, I find 90% looks nicer than 100%. But it is totally up to your eye.
I made some modification to #jvd10's solution. The '!important' seems too strong that the container doesn't adapt well when TOC sidebar is displayed. I removed it and added 'min-width' to limit the minimal width.
Here is my .juyputer/custom/custom.css:
/* Make the notebook cells take almost all available width and limit minimal width to 1110px */
.container {
width: 99%;
min-width: 1110px;
}
/* Prevent the edit cell highlight box from getting clipped;
* important so that it also works when cell is in edit mode*/
div.cell.selected {
border-left-width: 1px;
}
Note that if you do this the old way, you'll now get a deprecation warning. This uses the newer submodule naming:
from IPython.display import HTML
HTML("<style>.container { width:100% !important; }</style>")
I tried everything and nothing worked for me, I ended up using displaying my data frame as HTML as follows
from IPython.display import HTML
HTML (pd.to_html())
For Firefox/Chrome users, a nice way to achieve 100% width is to use a custom TamperMonkey script.
The benefits are
configure this once in your browser, no need to modify the server configuration.
works with multiple jupyter servers.
TamperMonkey is trusted, maintained, and stable.
Lots of additional customization is possible via javascript.
This script works for me https://gist.githubusercontent.com/mrk-andreev/2a9c2538fad0b687c27e192d5948834f/raw/6aa1148573dc20a22fca126e56e3b03f4abf281b/jpn_tmonkey.js
adding to answers by #jdv10 and #gerenuk
The best option is to add and tweak the custom.css file. Below I am
sharing my CSS file contents which I use to squeeze out the maximum
screen area in a Jupyter Notebook.
Since it targets the vanilla CSS codes of the rendered page, it is supposed to work for all types of
language used for coding on the Notebook.
/* Notebook styling */
body, p, div.rendered_html {
color: #93a1a1;
font-family: 'PT Serif', Georgia, Times, 'Times New Roman', serif;
font-size: 11pt;
}
body { background-color: #eee8d5 !important; }
/* the following controls aspects which are around the cells */
#notebook {
background-color: #073642 !important;
box-shadow: inset 20px 36px 20px -35px black !important;
margin: 1px !important;
padding: 1px !important;
}
#notebook-container {
padding: 2px !important;
}
/* Make the notebook cells take almost all available width */
.container {
width:99.5% !important;
/*margin:.5% !important;*/
/*color: #93a1a1 !important;*/
color: black !important;
background-color: lightblue !important;
}
/* Cell output */
.rendered_html pre, .rendered_html code {
color: inherit !important;
background-color: inherit !important;
}
.rendered_html table, .rendered_html td, .rendered_html th {
border: 1px solid #586e75 !important;
}
div.cell {
width:100% !important;
margin: 5px !important;
/* margin-left:2px !important; */
/* margin-right:2px !important; */
padding: 2px !important;
/* the following overrides the background color of the input area */
/* background-color: yellow !important; */
/* border-color: black !important; */
}
/* Prevent the edit cell highlight box from getting clipped; * important so that it also works when cell is in edit mode*/
div.cell.selected {
border-left-width: 5px !important;
border-right-width: 1px !important;
border-top-width: 2px !important;
border-bottom-width: 2px !important;
border-color: red !important;
}
/*this is for the area to the left of the editor or input area*/
div.run_this_cell {
width: auto !important;
color: green !important;
padding: 0 !important;
padding-top: 5px !important;
padding-left: 5px !important;
font-weight: bold !important;
font: 2em sans-serif;
}
div.input_area {
border-color: green !important;
background-color: #ffffdd !important;
}
.prompt {
line-height: 1em !important;
}
div.prompt {
min-width: auto;
background-color: white;
}
div.input_prompt {
color: #268bd2 !important;
color: #000000 !important;
font-weight: bold !important;
border: 1px solid #ff9900 !important;
background-color: greenyellow;
padding-right: 0px !important;
text-align: center !important;
width: auto !important;
font-size: 10px !important;
}
div.output_area {
color: #000000 !important;
background-color: #e2e2ff !important;
font-size: 0.9em !important;
}
/* Syntax highlighting */
.cm-s-ipython span.cm-comment {
/*color: #6c71c4 !important;*/
color: midnightblue !important;
color: rgb(100, 100, 170) !important;
font-style: italic !important;
}
.cm-s-ipython span.cm-string {
color: rgb(100, 20, 29) !important;
}

adding a border-radius without padding to fancybox2

I'm using fancybox 2 and I can get rid of the padding around the outside of the frame, but then I lose the border-radius that it comes with.
What I want is a border-radius around the main content inside the frame. So I tried going into the css and adding a border-radius to the fancy-box inner selector and it won't work. How can I give the frame a rounded corner without a border?
If anyone can help me with this that would be great!
Try this code it worked for me
Add custom classes after fancy box on complete method.
Ex.
HTML
Login
JS
$(document).ready(function(e) {
$(".signin-ovr").fancybox({
afterLoad : function(){
$("#fancybox-content").addClass('fancybox-content-cust');
$(".fancybox-bg").addClass('fancybox-bg-cust');
$("#fancybox-outer").addClass('fancybox-outer-cust');
}
});
});
CSS
.fancybox-content-cust {
overflow: visible !important;
border: 10px solid #FFFFFF;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.fancybox-bg-cust{
display: none;
}
.fancybox-outer-cust {
background: transparent !important;
}
Then you will get border radius to the overlay box.
for fancybox v2 round borders
.fancybox-outer, .fancybox-inner, .fancybox-skin {
background: none repeat scroll 0 0 rgba(0, 0, 0, 0);
border-radius: 10px!important;
}
CSS3 has a border radius property ironically enough entitled border-radius there are a few specific variations ie, Firefoxes moz-border-radius.
It is used like so:
#div-id .specific-class {
border-radius: 10px;
}
If you only want one rounded it has the ability to be modified like so
border-top-left-radius:2em;
border-top-right-radius:2em;
border-bottom-right-radius:2em;
border-bottom-left-radius:2em;
I hope this answers your question.

Drag & drop hints are lost in Telerik's RadControls for ASP.NET AJAX

I have a Telerik tree and drag & drop node move is in action. But then I applied a theme (bought from somewhere) to the overall design of my site, and now, the hint are gone.
When you drag a node, some horizontal hint lines appear, so that you can understand that if you release your node (drop it) where it would be dropped.
Try adding the following CSS to the page. It will force the styles upon the TreeView drop hint.
.rtDropAbove, .rtDropBelow {
border: 1px dotted black !important;
font-size: 3px !important;
height: 3px !important;
line-height: 3px !important;
margin-top: -1px !important;
}
.rtDropAbove {
border-bottom: 0 !important;
}
.rtDropBelow {
border-top: 0 !important;
}
Something's z-index property is messing up with Telerik's RadTree. It's all z-index stuff.