How to change color of Highlight syntax in asciidoc - asciidoc

I am using asciidoc extensively for documentation. I am also using the feature Highlight syntax feature of asciidoc.
By default it highlight the color in yellow, as in the following link: https://docs.asciidoctor.org/asciidoc/latest/text/highlight/
I googled to find out if it is possible to change the color, but did not find any useful information.
Question: Is it possible to change this color. Also is it possible to maintain more that one color for highlighting.

The colour of the highlight is determined by the converter you are using. For example, with the HTML converter, the text is surrounded by <mark> tags, and most browsers will style this yellow by default. You can change the colour of the <mark> element using CSS.
To add more than one highlight style to your document, you should use a custom inline style. Again, for the HTML converter, style the <span> elements using CSS.

The default stylesheet for asciidoctor currently contains the following custom inline styles for highlighting:
.aqua-background{background:#00fafa}
.black-background{background:#000}
.blue-background{background:#0000fa}
.fuchsia-background{background:#fa00fa}
.gray-background{background:#7d7d7d}
.green-background{background:#007d00}
.lime-background{background:#00fa00}
.maroon-background{background:#7d0000}
.navy-background{background:#00007d}
.olive-background{background:#7d7d00}
.purple-background{background:#7d007d}
.red-background{background:#fa0000}
.silver-background{background:#bcbcbc}
.teal-background{background:#007d7d}
.white-background{background:#fafafa}
.yellow-background{background:#fafa00}
I assume you are converting to HTML, in that case the easiest way to change the highlighting color would be to use these existing inline styles, like this:
#Werewolves# are [.red-background]#allergic# to [.aqua-background]#cinnamon#.

Related

How to change default styling of V-Data-Table footer?

I'm running into a problem where I can't style the default footer in v-data-table. For some reason, the pagination buttons are appearing white when enabled, and light gray when they are disabled (pagination is disabled). I've already double checked to make sure its not a theme issue.
My question is: how can I change the color of the default pagination icons in v-data-table? And more broadly, what is a way to find the class names of the vuetify elements so that I can avoid asking these types of questions in the future.
Thanks.
Here's a couple screen shots in case my description was clear enough.
Per Varun's request, here is one of my declarations for a v-data-table.
<v-data-table
:headers="headers"
:items="tickets"
item-key="ticketId"
class="red--text"
></v-data-table>
Result:
The recommendation of using the text-coloring class didn't work as it just turn all of the text in the table to red, but didn't change the icons. Is there any way to edit the CSS of the icons directly?
can you share the code please ?
Usually the color of the default pagination icons in v-data-table are black when enabled and grey while disabled.
you can use class="<color>--text" to change the text and enabled icon color to your preference
After digging through the CSS file in Vuetify and finding the class name of several of the v-data-table components, I found this solution to work.
Inside the style tag in my component:
#table > .v-data-footer .v-icon {
color: black;
}
Small note: without the !important keyword, this styles only the enabled icons in the footer (i.e. if you can go to the next page or not). If you want to style both, just add the keyword and your good to go.

How to assign text colors when working with Vuetify themes

I'm quite new to Vuetify and struggling to figure out how themes, components and text colors work together (if they do at all).
I want to work with theme color names in my templates like primary, secondary, warning, error and assign colors to those keywords by adding a new theme or overwriting the existing one.
This all works out of the box but the problem is I can't figure out how to set text colors in the same way. I want to assign a primary-text-color, secondary-text-color, etc. and have it automatically use the correct text color by default.
Text colors seem to change automatically when I change the color on buttons but nowhere else.
If I add a theme color to buttons, Vuetify automatically changes the text color to be readable, for example (just using the default theme):
<v-btn color='primary'>Test</v-btn>
Text will change to primary and the button will be perfectly usable
while a lighter color will have dark text:
<v-btn>Test</v-btn>
But other components don't behave the same. For example a v-app-bar component with default color has dark text on a light background, but a primary app bar keeps the dark text on a blue background.
It looks like I need to explicitly change the text color with a helper class or similar, and even then I'd have to use something like white--text instead of primary--text (which just applies the actual primary color to text).
I think I've read all the docs on the website but I can't find any reference to this particular problem
Sorry for the links to images, I don't have enough flair to embed them in my post.
currently, this works primary--text
<v-list-item-title v-if="company_name" class="title primary--text">
{{ company_name.company_name }}
</v-list-item-title>

Dailymotion embed video ui-theme and highlight color

Hi i need an example of how to change the theme and highlight color of the new Dailymotion player i use ui-theme and ui-hightlight as the Dailymotion guide indicates (link) or I just use highlight like some examples said but nothing happens.
<iframe id="iframe-video" width="16" height="9" src="//www.dailymotion.com/embed/video/x3mfcoi?highlight=FF0000" allowfullscreen></iframe>
It looks like you're not using the right parameter in the example you gave, this is why it's not working. As defined in the documentation, the relevant params are:
- ui-highlight
- ui-theme
For example, the following embed has the highlight color set to #FF0000:
http://www.dailymotion.com/embed/video/x2m8jpp_dailymotion-spirit-movie_creation?ui-highlight=FF0000
Note that you can't set a light highlight and light theme (and similarly, a dark highlight and dark theme), otherwise the control buttons are not visible. You can read more about it in our section related to player customisation.

CKEditor with noneditable islands

How can we have non-editable areas in a non-readOnly area?
Notice I still need most of the editor have editable content, so using readOnly mode is not an option. Setting contentEditable=true for those areas doesn't work, it seems like CKEditor strips all contentEditable values of it's children tags.
CKEditor 4.3 introduced Widget System which solves exactly this issue - it allows you to have non-editable fragments in the content. Actually, it allows you to do much more than that, because these non-editable islands may then have editable fragments, you can restrict per nested editable what features are enabled, etc.
Some links for the start:
Introduction to Widgets,
Widgets SDK introduction,
Creating a Simple CKEditor Widget (Part 1),
Widget API.
And some live examples:
Simplebox plugin,
Captioned images,
Code snippets with syntax highlighting,
Placeholder.
PS. I think you should also read about the Advanced Content Filter.

jQPlot pie chart - how to alter text color of pie slice labels

I am using jQPlot to draw a pie chart.
How can I change the color of the text that appears on each pie slice? There does not appear to be an option to do this.
It is not really a good idea to modify the distributed jqplot CSS file, because that makes for poor maintainability (you have to re-apply your changes if you, or anyone else, ever upgrades).
Instead, I recommend overriding the CSS using CSS Specificity Rules (see the Star Wars Version).
For example, given
<div id='myChart'; style="width:400px;height:300px;background-color:#eedd33">
</div>
You could define a CSS rule
#myChart
{
color: Teal;
}
You don't want to modify the given CSS file as it will modify all uses of the library.
You don't want to create a CSS rule for the entire chart container, as it will also apply the color to any legend or other text that will inherit it.
Instead, just modify the class jqplot uses for its data labels: .jqplot-data-label
Use this:
$('.jqplot-data-label').css("color","white");
This way, only the data labels will change color. All other text such as legend labels will not be changed.
In the end I just modified the top-level jqplot css that affects all text (as I wanted it all the same colour anyway).

Resources