[personal profile] rosefox posting in [community profile] style_system
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.

Date: 2009-09-13 04:21 pm (UTC)
branchandroot: oak against sky (Default)
From: [personal profile] branchandroot
Oh dear. That makes things a lot harder. *frowns* There should be a programming language category for this, one that allows for math to be done with the property. I don't suppose 'float' would work... *has never actually used float or double in her programming*

Date: 2009-09-13 06:16 pm (UTC)
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
From: [personal profile] afuna
Float or double, I guess. (But S2 doesn't support it D:)

I wonder if we could at least hack in a function that lets you try to add strings and ints? that is, if it's possible to make it a number, then calculate it as a number... I imagine that would be possible.

Date: 2009-09-13 06:20 pm (UTC)
branchandroot: oak against sky (Default)
From: [personal profile] branchandroot
*thoughtful* That does seem possible. I think there would have to be a case for each type of increment, to define how it's calculated, but ems and percentages are both a nice base ten scale, so it should be possible to do.

Profile

Dreamwidth style system discussion

June 2025

S M T W T F S
12345 67
891011121314
15161718192021
22232425262728
2930     

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 7th, 2025 01:51 am
Powered by Dreamwidth Studios