Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] CSS Styling doesn't work #842

Closed
OfflinePing opened this issue Aug 11, 2024 · 0 comments · Fixed by #845
Closed

[bug] CSS Styling doesn't work #842

OfflinePing opened this issue Aug 11, 2024 · 0 comments · Fixed by #845
Labels
bug Something isn't working

Comments

@OfflinePing
Copy link

OfflinePing commented Aug 11, 2024

What happend?

I get an error when trying to make a style.css Style

Error Message
panic: error marshaling CSS file: line 2: expected style before semicolon

goroutine 1 [running]:
main.main()
        C:/Users/Administrator/GolandProjects/BugReport/main.go:33 +0xa8
exit status 2

Code example

main.go
package main

import (
	_ "embed"
	g "github.com/AllenDang/giu"
)

//go:embed style.css
var cssStyle []byte

func loop() {
	Window := g.SingleWindow()

	Window.Layout(
		g.PopupModal("Popup Modal").Layout(
			g.Label("This is a popup modal"),
			g.Button("Close").OnClick(func() {
				g.CloseCurrentPopup()
			}),
		),
		g.Row(
			g.Button("Open Popup Modal").OnClick(func() {
				g.OpenPopup("Popup Modal")
			}),
		),
	)
}

func main() {
	wnd := g.NewMasterWindow("Cloud - Universal", 750, 500, g.MasterWindowFlagsNotResizable)

	if err := g.ParseCSSStyleSheet(cssStyle); err != nil {
		panic(err)
	}

	wnd.Run(loop)
}
style.css
main {
    background-color: black;
}

To Reproduce

  1. Run my demo
  2. will see the crash...

Version

master

OS

Windows 11

@OfflinePing OfflinePing added the bug Something isn't working label Aug 11, 2024
gucio321 added a commit to gucio321/giu that referenced this issue Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant