Class: Uniword::Mhtml::Theme
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Uniword::Mhtml::Theme
- Defined in:
- lib/uniword/mhtml/theme.rb
Overview
MHTML-specific Theme class
This is SEPARATE from OOXML DrawingML Theme. MHTML uses HTML/CSS for styling, not OOXML theme parts.
This class represents theme information extracted from MHTML documents and provides HTML/CSS output for MHTML serialization.
Instance Method Summary collapse
-
#color(name) ⇒ String?
MHTML-specific: Get theme color for CSS.
-
#font(name) ⇒ String?
MHTML-specific: Get theme font for CSS.
-
#to_css ⇒ String
MHTML-specific: Convert theme to CSS variables.
Instance Method Details
#color(name) ⇒ String?
MHTML-specific: Get theme color for CSS
37 38 39 |
# File 'lib/uniword/mhtml/theme.rb', line 37 def color(name) colors[name.to_s] end |
#font(name) ⇒ String?
MHTML-specific: Get theme font for CSS
45 46 47 |
# File 'lib/uniword/mhtml/theme.rb', line 45 def font(name) fonts[name.to_s] end |
#to_css ⇒ String
MHTML-specific: Convert theme to CSS variables
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/uniword/mhtml/theme.rb', line 22 def to_css css = +"" colors.each do |name, value| css << "--#{name}: #{value};\n" end fonts.each do |name, value| css << "--font-#{name}: #{value};\n" end css end |