Twine Version: 2.3.14
Story Format: Sugarcube 2.34.1
I’m trying to apply css styling to the custom buttons I want to use for my project. When I try to use a class, it throws an error, which I think is because the script call is part of it. I’ve been able to get it to work by changing the default button css, for both active and hover states, but that has the side effect of changing the appearance of every button, such as those in the Saves dialog, which kind of messes it up. I need some way of applying customized css styling to my buttons AND maintain hover functionality, also using my custom buttons.
Initially, I was trying to do this with fully colored custom buttons that included text, but I couldn’t set the hover version to trigger on mouseover. I got around it by creating a new button set that was transparent except for the borders, which would change color from green to yellow on hover. That allowed me to recolor the text from the button macro to match the image. But I don’t consider this ideal.
From my Start passage:
> <<button [[SAVE|Start]]>>
> <<script>>
> UI.saves();
> <</script>>
> <</button>>
From the stylesheet:
> button {
> margin : 0;
> padding-bottom: 10px;
> border : 0;
> height: 34px;
> width: 154px;
> color: limegreen;
> font-size: 12pt;
> font-family: "Calibri", sans-serif'
> text-align: center;
> background-color: transparent;
> background-repeat: no-repeat;
> background-image: url("images/DEF-T-lga.png");
> }
> button:hover {
> margin : 0;
> padding-bottom: 10px;
> border : 0;
> height: 34px;
> width: 154px;
> color: yellow;
> font-size: 12pt;
> font-family: "Calibri", sans-serif'
> text-align: center;
> background-color: transparent;
> background-repeat: no-repeat;
> background-image: url("images/DEF-T-lgh.png");
Now this does function, but because it alters the default button style, it messes up the buttons that aren’t using my customized set. This one opens the UI.saves dialog and stays on the same passage that it is being called from.
I’ve tried various configurations of div and span to try and get a custom class to apply without throwing an error, but nothing has worked.