Skip to content

Commit

Permalink
resolves asciidoctor#451 which suggest to use a stylable background f…
Browse files Browse the repository at this point in the history
…or btn:

Currently just a test commit to trigger feedback how to set the background colof a text element
  • Loading branch information
vogella committed May 24, 2016
1 parent 1b530ae commit aa8f345
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions data/themes/default-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ literal:
font_color: b12146
font_family: M+ 1mn
menu_caret_content: " <font size=\"1.15em\"><color rgb=\"b12146\">\u203a</color></font> "
button:
background_color: e7e7e7
heading:
#font_color: 181818
font_color: $base_font_color
Expand Down
12 changes: 10 additions & 2 deletions lib/asciidoctor-pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,16 @@ def convert_inline_break node
%(#{node.text}<br>)
end

def convert_inline_button node
%(<strong>[#{NarrowNoBreakSpace}#{node.text}#{NarrowNoBreakSpace}]</strong>)
def convert_inline_button node
button_bg_color = resolve_theme_color :button_background_color
if (button_bg_color)
# TODO use the button_bg_color to set the background of the node.text. Maybe similar to the following?
#%( <background-color> rgb=#{button_bg_color}><strong>[#{node.text}]</color></background-color>)
# Remove the following line once the TODO is fixed
%(<strong>[#{NarrowNoBreakSpace}#{node.text}#{NarrowNoBreakSpace}]</strong>)
else
%(<strong>[#{NarrowNoBreakSpace}#{node.text}#{NarrowNoBreakSpace}]</strong>)
end
end

def convert_inline_callout node
Expand Down

0 comments on commit aa8f345

Please sign in to comment.