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

$accent and $widgetBackground are not working #30

Open
buraks opened this issue May 21, 2024 · 2 comments
Open

$accent and $widgetBackground are not working #30

buraks opened this issue May 21, 2024 · 2 comments

Comments

@buraks
Copy link

buraks commented May 21, 2024

image

It seems like $accent and $widgetBackground are not working. Neither does for Pillar Valley from the looks of it.

IMG_F9E31A66CC84-1

I tried to fix the problem, but failed so far. @EvanBacon if you can point me in a direction I can try to provide a PR.

PS: Thank you so much for your work on this repo and open sourcing Pillar Valley. These have been super useful!

@bpingris
Copy link

hello! how are you setting up your colors?
in my expo-target.config.js I have:

/** @type {import('@bacons/apple-targets').Config} */
module.exports = {
	type: 'widget',
	name: 'Foobar',
	colors: {
		$primary: '#FF4239',
	},
	frameworks: ['SwiftUI'],
	entitlements: {
		'com.apple.security.application-groups': ['group.foo-bar.data'],
	},
	deploymentTarget: '15.0',
}

then I am able to use that color in my swift code with Color("$primary"), like:

            Text("Foo bar")
                .foregroundColor(Color("$primary"))

I have to run the expo prebuild -p ios command when updating the colors from my expo-target.config file

and my widget is using the colors I am setting, however I didn't try the light/dark theme property, maybe the issue you have is related to this?

@buraks
Copy link
Author

buraks commented Aug 5, 2024

The issue I am mentioning is not about how to use colors on Swift, that part works for me as well.

However, $accent and $widgetBackground are supposed to be special ones that end up setting some config on the XCode project

https://github.com/EvanBacon/expo-apple-targets/blob/main/packages/apple-targets/README.md?plain=1#L95

However, they don't seem to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants