Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Stylesheet stops being applied after a certain point

edited April 2015 in Help! with 1.x
I have a .tws with 70 passages using Sugarcane in 1.4.2 currently - it's likely to get a lot bigger.

When I add the 71st passage and "test play" the game, it appears as if the stylesheet stops being applied.  It doesn't matter what the content of the passage or its name is: as soon as I go above that 70 passage threshold...stylesheet doesn't work any more.

Anything I can do to deal with this?  I tried stopping at 70 passages in that .tws and then using storyincludes to add another .tws....same problem once it goes over 70!

Comments

  • As someone told me recently, check the Developer's console to see if there's something breaking the page.

    Have you tried another browsers?
  • Can't see any obvious problems in the console but not really sure what I'm looking for.

    Problem is the same in Chrome and Firefox.  It's caused directly by the number of passages - even if I add blank untitled passages above the limit it still happens, so it's not to do with the content in the additional passages at all.
  • Is it just suddenly the default stylesheet on passage #71, or are there still remnants? If so, is it possible something else is overriding the CSS at that point?
  • Yes, should have clarified - it's the default stylesheet after that point.
  • Huh, that's even more baffling than if it were just the browser defaults. Is something eating the container for the custom CSS or inserting an unclosed tag somewhere? Do you have much custom scripting?

    I'd be happy to take a look, if you were up for that. nicolemgames at gmail.com.
  • Thanks very much for the offer - I have someone else taking a look at the moment and if they don't come up with anything I will definitely send it your way soon.  I'll report back if we find anything useful as well.

    I can post the stylesheet here if that's useful?
  • Well, this was fixed by the inimitable nicolem!  Here were the things I'd done wrong - it's all just stupid CSS mistakes...

    1. You had an extra </script> tag at the end of your "transition" stylesheet passage.
    2. In "stylesheet", your .tab code block had no closing curly bracket. From the perspective of the CSS interpreter, this means all the subsequent selectors and rules "inside" .tab {} would be read as invalid rules and then invalid selectors after the first curly bracket.
    2a. There was an extra closing bracket at the end of "stylesheet".
    3. In "dosvga" (a font I'd included), you were missing your closing curly bracket.

    If anyone else has similar problems then having someone who knows what they're doing check through your bodged up CSS files is a good idea!  Many, many thanks to nicolem for this.
  • flipLyric, I'm glad I could help!

    I still don't totally understand WHY it was breaking after 70 passages, so if anyone's seen something similar, I'd love to hear your thoughts. :)
  • To be safe you could also change the default CSS directly in the HTML after story publish in the final version. I might end up doing something like that, just to avoid duplication and clean up the HTML, even if it's unnecessary.
  • Yeah, you're right, Claretta. flipLyric, it occurs to me that if you had only had a single stylesheet passage, then at least one of the errors would have been very obvious, if the entire stylesheet passage were to be copied into a text editor like Sublime Text or an online CSS validator tool.
  • You generally should only have only a single stylesheet and a single javascript related passages in your story.

    The reason for this that the order that CSS rules are applied is important and there is no way to control which order multiple stylesheet related passages will be processed/applied. The same goes for javascript related passages.
Sign In or Register to comment.