|
19 | 19 |
|
20 | 20 | public class GeneratorModel { |
21 | 21 | private static final String CN1_PLUGIN_VERSION = "7.0.227"; |
| 22 | + private static final String PREVIEW_BUTTON_SELECTOR = |
| 23 | + "Button, InitializrLiveButtonDarkClean, " |
| 24 | + + "InitializrLiveButtonLightTealRound, InitializrLiveButtonLightTealSquare, " |
| 25 | + + "InitializrLiveButtonDarkTealRound, InitializrLiveButtonDarkTealSquare, " |
| 26 | + + "InitializrLiveButtonLightBlueRound, InitializrLiveButtonLightBlueSquare, " |
| 27 | + + "InitializrLiveButtonDarkBlueRound, InitializrLiveButtonDarkBlueSquare, " |
| 28 | + + "InitializrLiveButtonLightOrangeRound, InitializrLiveButtonLightOrangeSquare, " |
| 29 | + + "InitializrLiveButtonDarkOrangeRound, InitializrLiveButtonDarkOrangeSquare"; |
| 30 | + private static final String PREVIEW_BUTTON_PRESSED_SELECTOR = |
| 31 | + "Button.pressed, InitializrLiveButtonDarkClean.pressed, " |
| 32 | + + "InitializrLiveButtonLightTealRound.pressed, InitializrLiveButtonLightTealSquare.pressed, " |
| 33 | + + "InitializrLiveButtonDarkTealRound.pressed, InitializrLiveButtonDarkTealSquare.pressed, " |
| 34 | + + "InitializrLiveButtonLightBlueRound.pressed, InitializrLiveButtonLightBlueSquare.pressed, " |
| 35 | + + "InitializrLiveButtonDarkBlueRound.pressed, InitializrLiveButtonDarkBlueSquare.pressed, " |
| 36 | + + "InitializrLiveButtonLightOrangeRound.pressed, InitializrLiveButtonLightOrangeSquare.pressed, " |
| 37 | + + "InitializrLiveButtonDarkOrangeRound.pressed, InitializrLiveButtonDarkOrangeSquare.pressed"; |
22 | 38 | private static final String GENERATED_GITIGNORE = |
23 | 39 | "**/target/\n" + |
24 | 40 | ".idea/\n" + |
@@ -550,11 +566,21 @@ private static String normalizeCustomCss(String css) { |
550 | 566 |
|
551 | 567 | public static String normalizeCustomCssForCompiler(String css) { |
552 | 568 | String out = css; |
| 569 | + out = expandPreviewButtonAliases(out); |
553 | 570 | out = replaceKnownNamedColors(out); |
554 | 571 | out = addAlignFallback(out); |
555 | 572 | return out; |
556 | 573 | } |
557 | 574 |
|
| 575 | + private static String expandPreviewButtonAliases(String css) { |
| 576 | + String out = css; |
| 577 | + out = StringUtil.replaceAll(out, "Button.pressed {", PREVIEW_BUTTON_PRESSED_SELECTOR + " {"); |
| 578 | + out = StringUtil.replaceAll(out, "Button.pressed{", PREVIEW_BUTTON_PRESSED_SELECTOR + "{"); |
| 579 | + out = StringUtil.replaceAll(out, "Button {", PREVIEW_BUTTON_SELECTOR + " {"); |
| 580 | + out = StringUtil.replaceAll(out, "Button{", PREVIEW_BUTTON_SELECTOR + "{"); |
| 581 | + return out; |
| 582 | + } |
| 583 | + |
558 | 584 | private static String replaceKnownNamedColors(String css) { |
559 | 585 | String out = css; |
560 | 586 | out = replaceCssColorValue(out, "pink", "#ffc0cb"); |
|
0 commit comments