Text with background color and rounded borders in asciidoctor-pdf - asciidoc

I am trying to create some badge-like texts for my documentation, to highlight the status of some issues.
Here are some examples (jira issues embedded in a confluence wiki)
Example for a "closed"-badge
Example for "waiting for solution"-badge
I even struggle to find any simple way to set a background-color for a text in asciidoctor-pdf.
The most promising attempt was using a themed button-macro.
btn:[Closed]
with this theme-section:
button:
background-color: #88FF88
border-color: #33FF33
border-radius: 5
border-width: 0.5
border-offset: 3.0
The result is quite close to what I hoped to achieve, however I cannot have buttons with different colors. Or is it possible to overwrite the theme-values in the *.adoc file itself?
Is there any other possibility to create something similar in asciidoc-pdf?

Related

Keeping an image horizontally aligned with another image. Flexbox I don't think is the answer. I think I need some sort of scss calc()

I'm trying to align horizontally two images that are next to each other with different dynamic text under it. If you review the image I attached it's pretty clear what I'm trying to do. I don't think flexbox properties like flex-end or flex justify-content: space-between will work here. Thanks for your help in advance.
https://i.stack.imgur.com/QYCMh.jpg
enter image description here
So I figured out a solution. I used calc() to achieve the results
position: absolute;
width: calc(100% - 50px);
margin-top: calc(112.1% - 980px / 25);
This calc keeps the image stuck to the image next to it. Not sure what the unit numbers mean, I basically fiddled with the units until I got the results I wanted.
Heres the result https://gifyu.com/image/vnPX

Ace Editor selected text not highlighting properly

I am testing the Ace Editor in their Kitchen Sink demo using the Mono Industrial theme and when I select text, it only highlights part of the line I selected. Here is a screenshot showing what I mean:
https://www.screencast.com/t/SnkUrwMql3J
Is there a setting or CSS hack that might fix it?
I was able to fix the issue with this bit of css:
.ace-mono-industrial .ace_string {
background-color: transparent !important;
}
This looks like a bug in mono industrial theme of ace. It sets background to the text which covers the selection.
You may be able to use a css hack like
.ace_line>span {
background-color: transparent!important;
}
or make a more specific selector to match only classes that actually define a background-color

Why is my font-face adding space at the baseline?

My font is doing something weird. There seems to be space being added below the font (Not the margin) that is pushing it up above the line-height. If I adjust the height it seems to be anchored to the bottom of the line height so instead of increasing the space below it actually pushes the top of the font above the line height. Is there any way, save adding margin or padding to the top, to make sure it's anchoring to the top of the line-height or middle?
CSS:
#font-face {font-family: 'AvenirLTStd-Book';src: url('/us/_media/font/2CA9EF_0_0.eot');src: url('/us/_media/font/2CA9EF_0_0.eot?#iefix') format('embedded-opentype'),url('/us/_media/font/2CA9EF_0_0.woff2') format('woff2'),url('/us/_media/font/2CA9EF_0_0.woff') format('woff'),url('/us/_media/font/2CA9EF_0_0.ttf') format('truetype');}
#font-face {font-family: 'AvenirLTStd-Black';src: url('/us/_media/font/2CA9EF_1_0.eot');src: url('/us/_media/font/2CA9EF_1_0.eot?#iefix') format('embedded-opentype'),url('/us/_media/font/2CA9EF_1_0.woff2') format('woff2'),url('/us/_media/font/2CA9EF_1_0.woff') format('woff'),url('/us/_media/font/2CA9EF_1_0.ttf') format('truetype');}
h1,h2,h3,h4,h5,h6 {
font-family:'AvenirLTStd-Black', Arial, sans-serif;
margin-top: 0;
font-weight: normal;
line-height: 1em;
color: inherit;
text-rendering: optimizelegibility;
-webkit-font-smoothing: antialiased;
letter-spacing:1px;
}
I know this is old, but I thought I'd leave a comment for others Googling this issue.
It looks like you are using Avenir from MyFonts.com, which allows you to 'tweak' your webfont package.
I had the same issue as above, changing the Line Height Adjustments to use Bounding Box (Match the bounding box of the glyphs, line gap will always be 0) fixed the issue
I used the settings in the screenshot below:
[link to screenshot is down]
The idea is to increase line-height to decrease the space at the baseline, i.e.:
h1 {
font-size: 2rem;
line-height: 3rem;
}
I was on this for a while now and since I have no Myfonts.com account and the font is free font generated by FontsQuirrel or downloaded from GF I had to experiment. In PS my font looks correct by comparison,
Montserrat vs Open Sans
But webfont is completely off.
I was than forced to test several font editing software. First I tested FontForge and could simply not figure out the proper metrics, than i got trial FontCreator that has this great feature that auto calculates the metrics which when entered in FontForge fix the issue.
But paying $79.00 min to just fix this and never use the software again did not seem feasible and I also did not want to go back and forth between the two to get the metrics. I continued to play with FontForge and finally found the solution. You must reset all values to 0 in Element -> Font Info -> OS/2 -> Metrics and than uncheck the "Is Offset"
Instead another image here is short video that shows how to fix this
http://take.ms/rJpqh
Note that for some fonts it is better to uncheck the Really use Typo metrics which helped in my case.
The attribute you have missed out is 'vertical-align' and it is probably causing all of the trouble
This tells the browser where to align the text
It has the following values (not all are listed):
baseline
sub
super
middle
top
bottom
To find out more click here

Colorbox plugin borderless view

I need use a modal plugin and colorbox looks great.
How do I load it w/o the rounded borders?
Given my page size, the thick border taking too much space.
Anyway to hide it or make it thinner and hide the border if needed on some calls?
You can hide the borders in easy way:
$("#cboxTopLeft").hide();
$("#cboxTopRight").hide();
$("#cboxBottomLeft").hide();
$("#cboxBottomRight").hide();
$("#cboxMiddleLeft").hide();
$("#cboxMiddleRight").hide();
$("#cboxTopCenter").hide();
$("#cboxBottomCenter").hide();
and add class with border style if you want with this way :
.thin_border {
border: 10px solid blue;
border-radius: 10px;
margin: 10px;
box-shadow: 0 0 25px blue;
}
and then add it with jquery
$("#cboxContent").addClass("thin_border");
I think colorbox isn't actually using the property "border" to get that huge black border going around. It seems like its being incased in a 3 x 3 div which uses images to create that border. Im sure you could remove it but its going to require messing with the actual colorbox javascript. You could try messing with the CSS as well.
You consider looking into a diffrent plugin like lightbox2 or shadowbox? I personally use slimbox (nice little clone of lightbox). If you want to mess with the code go for it. Otherwise I would just pick a diffrent plugin.

Is it possible to change the scrollbar width in windows gadgets?

Does anyone know if it is possible to create a thinner scrollbar for my windows gadget.
I am already using these attributes to change the scrollbar colors:
scrollbar-face-color: #EEEEEE;
scrollbar-highlight-color: #FFFFFF;
scrollbar-3dlight-color: #CCCCCC;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-shadow-color: #AAAAAA;
scrollbar-arrow-color: #000000;
scrollbar-track-color: #EEEEEE;
I was hoping that since the gadget seems to be using the IE rendering engine in quirks mode, there is some option to specify the gadget width?
I guess, if this is not possible, I could use some sort of jQuery plugin that imitates a scrollbar and allows for more customization...
Thanks!
I do not believe it is possible to actively change the width without developing your own control. The scrollbar width is a system wide setting, not an application dependent one. You can identify how wide it is though with: System.Windows.Forms.SystemInformation.VerticalScrollBarWidth;
Change Scrollbar information:
http://community.infragistics.com/forums/p/9516/37132.aspx
Identify Scrollbar Information:
How do I know the current width of system scrollbar?

Resources