GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

Ignite - Using the .style modifier

Forums > Swift

I created a website with Ignite early last year, where I could style many items using the style modifier like so:

.style("text-decoration: none; color: #FFF; padding-left: 20px;")

Sometime later Ignite was extensively changed and that no longer works. I have been pulling my hair out trying to add multiple styles in one style modifier but can't seem to get it to work. Single modifiers do work.

Can anyone show me how this is accomplished?

Thanks!

   

Look like .style requires style(_ property: Property, _ value: String) however this may hint to what you looking for.

.style(
    .init(.height, value: "100%"),
    .init(.objectFit, value: "cover"),
    .init(.opacity, value: backgroundOpacity.formatted(.nonLocalizedDecimal))
)

   

Hacking with Swift is sponsored by Alex.

SPONSORED Alex is the iOS & Mac developer’s ultimate AI assistant. It integrates with Xcode, offering a best-in-class Swift coding agent. Generate modern SwiftUI from images. Fast-apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek R1. Autofix Swift 6 errors and warnings. And so much more. Start your 7-day free trial today!

Try for free!

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.