Are there any possible ways to customize the styling of RunKit (https://runkit.com)? Like make the background of the editor to dark theme.
I tried injecting styles to the RunKit iframe but it does not work. Looking for any suggestions or any solutions.
1. Summary
Use RunKit theme maker.
It not documented for June 2019.
2. Demonstration
Gutter line numbers in left side has a bad visible.
Codepen demo:
I edit Text parameter in theme-maker.
Codepen demo:
(But besides line numbers RunKit also change text color of my notebook.)
3. Disclaimer
Data of this answer were relevant in June 2019 and may be obsolete in the future.
Method of this answer is uncomfortable, and I very hope that in the future there will be another.
4. Note
You can't overwrite embed RunKit and any another iframe styles of another domain via CSS:
How to apply CSS to iframe?
Override body style for content in an iframe
5. Sources
5.1. Without styles
I attach RunKit to existing element.
Codepen demo:
<script src="https://embed.runkit.com" data-element-id="KiraRunkit"></script>
<article>
<pre id="KiraRunkit">
var stringSimilarity = require('string-similarity')
var similarity = stringSimilarity.compareTwoStrings('Кира', 'Кирк');
</pre>
</article>
body
height 100%
overflow hidden
background-color sienna
article
margin-left 2rem
margin-right 2rem
// [INFO] Responsive iframe:
// https://medium.com/#mahbub_hemel/how-to-make-your-video-iframe-responsive-a8c5fda821ba
#KiraRunkit
width 100%
position relative
iframe
width 100%
height 100%
position absolute
/* [INFO] Instead of frameborder — http://stackoverflow.com/a/10831379/5951529 */
border 0
5.2. With styles
I programmaticaly create a notebook. Options:
element — HTML element, for which you will apply RunKit.
source — full source of your RunKit notebook; use \n for line breaking.
syntaxTheme — theme, that you create.
JavaScript code you find in your theme-maker page.
Codepen demo:
<script src="https://embed.runkit.com"></script>
<article>
<div id="KiraRunkit"></div>
</article>
body
height 100%
overflow hidden
background-color sienna
article
margin-left 2rem
margin-right 2rem
// [INFO] Responsive iframe:
// https://medium.com/#mahbub_hemel/how-to-make-your-video-iframe-responsive-a8c5fda821ba
#KiraRunkit
width 100%
position relative
iframe
width 100%
height 100%
position absolute
/* [INFO] Instead of frameborder — http://stackoverflow.com/a/10831379/5951529 */
border 0
##########
# RunKit #
##########
# Run npm code online in browser:
# https://runkit.com
# Needs use theme-maker, that change styles:
# https://runkit.com/docs/theme-maker
notebook = RunKit.createNotebook(
# [NOTE] Id required, class will not work
element: document.getElementById('KiraRunkit')
# [NOTE] You need paste here content of your RunKit notebook even if it big:
source: 'var stringSimilarity = require(\'string-similarity\')\n\n\
var similarity = stringSimilarity.compareTwoStrings(\'Кира\', \'Кирк\');'
# [INFO] https://runkit.com/docs/theme-maker/untilted-2jxk2crve1p7 theme
syntaxTheme: 'untilted-028u85ijnoyr')
6. Problems
You can have these problems, when you edit your theme via theme-maker:
If you need set exact color, You have to work hard, that make it in theme-maker.
After the second and subsequent theme editions, changes may not display.
Read notes in CoffeeScript file from previous section, that read about another limits.
7. Extra links
Discussion on RunKit forum
GitHub pull request, that add theme and gutterStyle properties
Related
Was hoping to increase the height of the google map module in Divi but my CSS code is not working and do not understand why. I am pasting the following code within Advanced > Custom CSS > Main Element of the Map Module
.et_pb_map {
height: 440px;
}
Any suggestions would be very useful!
Absolute Map for Divi Theme
Add the following CSS in the Row Settings/ Custom CSS/ Column "1" Main Element (column number is where you will put the map):
position:relative;
Add a Class to Map Module. In this example the CSS Class is absolute_map
Add the following CSS in the Custom CSS box:
.absolute_map .et_pb_map {
position: absolute;
overflow:visible;
height: 100%;
}
Be happy!
Try to add padding instead of an explicit increase of height.
#map ,#map .et_pb_map {padding-bottom: 56.25%}
You might have to adjust the selector. Usually #map is enough though.
and adjust the padding percentage to modify the aspect ratio. This is responsive.
The reason why this might work is because padding creates more space for the background - map in the case of this iframe - to be painted thus expanding it.
Read more on this here
Working demo on JSFiddle
If you're customizing through that section (Advanced > Custom CSS > Main Element) of the Divi Builder, just add the property declaration not the entire CSS rule.
height: 440px;
no need to add css class in the advanced > custom css. just add the property value 440px.
use !important for overnight css
.et_pb_map {
height: 440px !important;
}
Just add !important to your css
.et_pb_map {
height: 440px !important;
}
Use below code.
Please use your google API key here in this js file.
If you wanted to increased/decreased height of map then do changes in #div_gmap.
#div_gmap {
height: 440px;
}
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
async defer></script>
<div id="div_gmap"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('div_gmap'), {
center: {lat: 22.3039, lng: 70.8022},
zoom: 12
});
}
</script>
If this thing is not working well then might need to check some of the css or any other framework causing this issue.
The best way to test out why the css dimension code doesnt work is to use chrome dev tool.
Press Shift+ Ctrl + I (or cmd + alt + I if you are safari user) and open up the web dev tool bar. Go to the Elements section and you will see styles controller. In the styles controller, you click on the elements you wanna check on the DOM side, in your case, it's probably <div class="et_pb_map">...</div>, or you can press ctrl+f to search et_pb_map.
After you have done that, you can go to the box viewer in the style tab and see why it doesnt work out.
I would say sometimes if you use padding/margin and didnt set overflow property well, it will crop out your elements. Or maybe your class is being overlapped by other class. You can use embed style to override that <div class="et_pb_map" style="...">...</div>, or simply put your class as the last class in the class attributes.
Example on using chrome web dev tool bar
Go to Appearance -> Customize -> Additional CSS and paste this code
.et_pb_map iframe {height: 400px !important; }
This will help you Check this jsfiddle
This is the only solution that worked for me. Assign a class to your map module i.e. .map-height and target it like this:
.map-height .et_pb_map {
overflow:visible;
height: 500px!important;
}
The simple approach is:
Go to Divi Theme Options
Scroll down to Custom CSS
Enter .et_pb_map {height:500px;}
Click Save Changes (the map will now change to 500px height)
I am trying to set the minimum width of the angular UI bootstrap progressbar. I checked the docs and they do not mention how to do this. I know for the 'regular' bootstrap you can use something like style="min-width: 10em;". However this only works if you wrap it in the standard progress bootstrap divs like so:
<div class="progress">
<uib-progressbar class="progress-striped active progress-bar" value="value" style="min-width: 10em;">
<span> text </span></uib-progressbar>
</div>
But this displays a progressbar bar without the 'active' animation since regular bootstrap does not support this. When I try it like so it does not set the min-width property
<uib-progressbar class="progress-striped active progress-bar"value="value" style="min-width: 10em;">
<span> text </span>
</uib-progressbar>
edit: I overlooked the animation section in the 'regular' bootstrap docs. I would however like to use the UI bootstrap progressbar if possible.
Regular Bootstrap supports animated progress bars.
Are you sure that you correctly imported Boostrap files? I think you might have included only the CSS file but not the JS. Take a look at the basic template to see which files you should include.
Take also a look at the uib-progressbar documentation. The code snippet you wrote seems to be correct. As I said, I think the reason for this problem is that you didn't include the JS file for Bootstrap.
EDIT: Oh, ui-bootstrap apparently doesn't need Bootstrap's JS, you're right.
Regarding the min-width part of your question: I noticed that you added the progress-bar class to the <uib-progressbar> element. According to the documentation, the progress-bar class should not be used (it will be added by ui-bootstrap to the <div> element that will be rendered inside <uib-progressbar>, and you can easily verify this by inspecting the progress bar width devtools).
Thus, the min-width property is to be applied to the internal <div>. However, since the rendering is managed by angular, the only way to change it is to add a CSS rule like this:
.setminwidth .progress-bar {
min-width: 20em;
}
And then add the new setminwidth class to the external <uib-element> like this:
<uib-progressbar class="progress-striped setminwidth" value="22" type="warning">22%</uib-progressbar>
I tested this but it doesn't seem to work. I think it's because min-width: 0; is hardcoded in the template, and it gets reset everytime ui-bootstrap re-renders the element.
I tried adding !important to the CSS rule, to avoid being overridden, but it doesn't work either.
I guess at this point you should consider why you need to add this min-width property, since ui-bootstrap likes to override it. Could it be because you don't want the progress bar to be "too empty" when the % is low? If that's the case, I think you should look up the changes recently introduced by Bootstrap: it seems that now they add a special min-width for 0%, 1% and 2%.
UPD: The Bootstrap folks apparently changed their mind and reverted the special min-width value. At this point, I think that ui-bootstrap should follow along and remove the hardcoded min-width: 0; as it's not needed anymore. I just sent a pull-request to them. If they merge it, you will be able to use the CSS I posted above.
I'm working on a Polymer app. I keep running into oddities. At this time, I'm trying to put a paper item in my app. At runtime, these elements appear to add an HTML element that looks like this:
<div id="contentIcon" class="content-icon style-scope paper-icon-item">
</div>
For some reason, this element is always 56px in width. In the Chrome Developer tools, I can see width:56px. If I set it to width:0px in the Chrome Dev tools, the UI looks how I want. In an attempt to do this, I added the following to my CSS:
.content-icon.paper-icon-item {
width:0px !important;
}
However, the 56px width still remains. I do not understand why at I have to do to remove this 56px width.
Thanks,
Why are you using a class attribute for defining a web component?
That syntax seems quite weird.
Can you please provide with more specific description regarding this issue as it doesn't seems clear.
AFAIK, the correct syntax for including a paper-item component in your code should be:
<paper-item>
<paper-item-body two-line>
<div>Show your status</div>
<div secondary>Your status is visible to everyone</div>
</paper-item-body>
<iron-icon icon="warning"></iron-icon>
</paper-item>
How I can remove space between wordpress Divi theme's sections?
Vasili has a great answer, however, when you view the properties of a row/column in the Divi builder - you will see two rows of settings for Custom Margin and Custom Padding. These will be under the regular options on some elements, and under Advanced Design Settings on others.
By default those are left blank, however that does NOT mean that they are set to 0. If you change the padding on top/bottom and margin on top/bottom to 0 you should be able to remove the space without having to use code, and a ton of CSS !important tags.
As a general rule of thumb, avoid !important tags as much as possible. Overwriting certain rows in DIVI is not always going to be effective - you may have a row where you need padding on one page, and twenty that you don't on others. I would suggest trying to do as much as possible through the builder, if that is what you are using to build the page.
To make this more useful for beginners.
Without using code you can try if just putting another row within the same section is enough for you.
If not we could do what poostchi has done we can change the css for the section.
Now if you go to your website and right click a section and select inspect element (assuming your browser is chrome) you will see your section coded like this.
<div class="et_pb_section et_section_regular" style="background-color:#2388e0;">
<div class="et_pb_row">
<div class="et_pb_column et_pb_column_4_4">
<div class="et_pb_text et_pb_bg_layout_dark et_pb_text_align_left">
This is row 1 section 1
</div> <!-- .et_pb_text --><div class="et_pb_text et_pb_bg_layout_light et_pb_text_align_left">
this is row 2 of section 1
</div> <!-- .et_pb_text -->
</div> <!-- .et_pb_column -->
</div> <!-- .et_pb_row -->
</div>
Here we see they are using the class et_pb_section
clicking on the class name will show the class css code which has the 50 pixels padding value:
.et_pb_section {
padding: 50px 0;
position: relative;
}
So all we have to do is overwrite the padding value there to 0 which was what pootschi has done.
.et_pb_section{
padding-top: 0px !important;
}
the !important tells css to overwrite with this.
But by doing this ALL your sections DIVI defined padding value will be overwritten.
So what if you only want to reduce a gap for only a specific section?
Divi has included the css ID an css CLASS to allow better customization over their sections an modules. You can find this by clicking on the edit button of our section.
CLASS method
Give your section a CSS CLASS name: reduce_top_padding_here
then you can do this.
.reduce_top_padding_here {
padding-top: 0px !important
}
Now where do we put this css code?
Divi has allowed easy css edit by going into
Appearance > Divi Theme Options > General Settings >
scroll down to find "Custom css" (paste the code in here.)
Explanation:
Here you have created your own css class. So ONLY the section or module that you give this class name to, will inherit this css display instruction to give the top padding 0 pixels. Instead of over writing DIVI's main .et_pb_section class.
Note the dot in front of the class name means in css that name is a class.
So summary to edit a specific section
1- Give your section a CSS CLASS
2- then define that CSS class value in divi theme options > "custom css"
I'm not sure if Divi theme had this at the time but if you go to the Divi Theme Customizer > General Settings > Layout Settings there's Section Height and Row Height.
For mobile go to the Divi Theme Customizer > Mobile Styles, Phone and Tablet both have section and row heights.
You still may need some CSS.
I just found it!
.et_pb_section{
padding-top: 0px !important;
}
I would like to expand on what Vasili has shared, in order to provide a more complete answer (especially regarding the exclusion of full width sections).
I suspect Alex Seidler's answer has missed the point. I suspect the questioner wants to remove this padding site wide. Doing that via the Divi builder, as he suggested, is going to be very tedious and will in fact introduce a lot more (Divi generated) additional CSS to the site, including all the !important tags (regarding that, see the last note at the end of this answer).
Just as Vasili and the person who asked the question has pointed out, the following code will override the padding on all sections.
.et_pb_section{
padding-top: 50px !important;
}
Note, that 54px top and bottom is currently the default on screens over 1350px. 4% is the default on screens 981p and less. I say "currently" because I recall it used to be 50px. It might still be 50%. Whatever the case, reduce this according to your needs. The questioner wants all spacing removed, in which case set it to padding-top: 0 !important.
Excluding full-width sections
The above-mentioned change may have some undesirable effects if you use any full width sections. If that occurs, you may want to exclude those sections, with the following:
:not(.et_pb_fullwidth_section).et_pb_section {
padding-top: 50px !important;
padding-bottom: 50px !important;
}
Remember, this will impact all rows, within all sections.
Specific Sections only
If you want to only override the padding on specific sections, use the suggestion made by Vasili in his answer.
Reducing Row padding
Anyone wanting to reduce the default section vertical padding might also find themselves wanting to reduce Row vertical padding.
For that, add this CSS to your child-theme styles.css file:
.et_pb_row { padding-top: 30px !important; }
30px is the default. Reduce this to suit your needs.
Specific Rows only
To reduce specific rows only, you can either do it on a row-by-row basis in the Divi Builder "Design" tab for the row(s) in question, or you can give the rows a unique class (in the "Advanced" tab of the row settings), and then apply the settings to that class in your your child-theme styles.css file. This is the same process as changing specific sections. For example, give the rows the class `row-reduced-top-padding' and then it the styles.css file:
.row-reduced-top-padding { padding-top: 10px !important; }
The advantage of this method is it is much faster to adjust the settings later on, especially if you've applied this to quite a few rows.
Avoiding !important, not possible
As for the comment from Alex Seidler about avoiding using the !important tag: Whilst it's true it's best to avoid this, in this situation it's unavoidable. Last time I checked, even Divi itself will use the !important tag when you make changes to the margins and padding of sections and rows via the Divi Builder. This is because it is also having to over-ride the site-wide defaults, which have already been declared by Divi.
I have placed images on wordpress page templates without any inline style attribute but its seem wordpress automatically add style tag with width and height set to zero.
<img src="wp-content/themes/ecoblog/images/hiw-image-1.png" style="width: 0px; height: 0px;">
Sometimes height is set to its original dimentsions and sometimes after complete refresh its values are zero.
What is causing this?
Please help me out. Thanks in advance.
Maybe it is caused by incorrect CSS. Zero values should not have dimensions, like px or pt. Like this:
<img src="wp-content/themes/ecoblog/images/hiw-image-1.png" style="width:0; height:0;">
this is because of template CSS styles are override your image style properties ..,the easy way is to wrap your image content and give div id and put your style code in template CCS file
inside(style.css)
it works as:
.class{
width:20px !important;
height:20px !important;
}
or if you want to remove Inline CSS completely , This inline css may be in .php files or in.js files.
You can search style in whole project , it is easier to search if you are using netbeans code editor.
Hope it may resolve.