Web-Simple

 view release on metacpan or  search on metacpan

lib/CSS/Declare.pm  view on Meta::CPAN

speak_punctuation
speech_rate
stress
scrollbar_arrow_color
scrollbar_base_color
scrollbar_dark_shadow_color
scrollbar_face_color
scrollbar_highlight_color
scrollbar_shadow_color
scrollbar_3d_light_color
scrollbar_track_color
table_layout
text_align
text_align_last
text_decoration
text_indent
text_justify
text_overflow
text_shadow
text_transform
text_autospace
text_kashida_space
text_underline_position
top
unicode_bidi
vertical_align
visibility
voice_family
volume
white_space
widows
width
word_break
word_spacing
word_wrap
writing_mode
z_index
zoom
};

sub _export_tags_into {
  my ($class, $into) = @_;
   for my $property (@properties) {
      my $property_name = $property;
      $property_name =~ tr/_/-/;
      no strict 'refs';
      *{"$into\::$property"} = sub ($) { return ($property_name => $_[0]) };
   }
  return sub {
    foreach my $property (@properties) {
      no strict 'refs';
      delete ${"${into}::"}{$property}
    }
    $IN_SCOPE = 0;
  };
}

sub _install_unexporter {
  my ($class, $unex) = @_;
  $^H |= 0x20000; # localize %^H
  $^H{'CSS::Declare::Unex'} = bless($unex, 'CSS::Declare::Unex');
}

sub to_css_string {
   my @css = @_;
   return join q{ }, gather {
      while (my ($selector, $declarations) = splice(@css, 0, 2)) {
         take "$selector "._generate_declarations($declarations)
      }
   };
}

sub _generate_declarations {
   my $declarations = shift;

   return '{'.join(q{;}, gather {
      while (my ($property, $value) = splice(@{$declarations}, 0, 2)) {
         take "$property:$value"
      }
   }).'}';
}

package CSS::Declare::Unex;

sub DESTROY { local $@; eval { $_[0]->(); 1 } || warn "ARGH: $@" }

1;



( run in 0.531 second using v1.01-cache-2.11-cpan-ceb78f64989 )