rosefox: Green books on library shelves. (Default)
Asher Rose Fox ([personal profile] rosefox) wrote in [community profile] style_system2009-09-12 10:33 pm

Weird error with int vs. string

I just tried to edit my style and got this error:

S2 Compiler Output at Sun Sep 13 02:31:23 2009
Error compiling layer:

Compile error: line 170, column 5: Can't override property 'font_base_size' of type string with new type int.
S2::NodeProperty, S2/NodeProperty.pm, 120
S2::NodePropGroup, S2/NodePropGroup.pm, 77
S2::Checker, S2/Checker.pm, 374
S2::Compiler, S2/Compiler.pm, 34


Context

166: property string font_base {
167: des = "Default Font for the page";
168: note = "This font will apply to the entire page as the base font. If you set any of the other font properties below, they will override this setting for that specific part of the page.";
169: }
170: property int font_base_size {
171: des = "Default Font Size for the page.";
172: }
173: property string font_header_title {
174: des = "Font for the Header Title";




What I can't figure out is why it expects it to be a string.

To confuse things further, this code has been in my style for ages and has always compiled fine before. It's completely unrelated to what I was changing. In fact, when I refresh the page and then hit "Save & compile" without making any changes at all to my existing and entirely functional style, I get that error.

Any idea how to fix it?

EDIT: I gave up and made all the ints into strings, and it mostly seems to be working okay except that now my menu bar is a million pixels high because it's supposed to be the header font size plus 8 and of course you can't add 8 to a string. I may just have to hardcode that. GRRR.
ninetydegrees: Art & Text: heart with aroace colors, "you are loved" (Default)

[personal profile] ninetydegrees 2009-09-13 09:25 am (UTC)(link)
Very common with proportional units, which are recommended for better practices. Some defaults sizes in browsers are set with decimals. For example, H2 headings are set to 1.5em, H3s to 1.17em, etc.

And Dreamwidth base font size is set to 0.75em.
Edited 2009-09-13 09:29 (UTC)