Comments (5)
Hi, Joe! I've added initial support for gradients; they work really well. However, they are background gradients, whereas you're looking for masking what looks like something fairly custom. From what I understand, there is some CSS support for this with a WebKit prefix, but there isn't any support for it in Ignite at this time.
from ignite.
This looks great, I love how you mimicked SwiftUI's backgroundStyle
.
I did a little bit of research and admittedly my web development experience is relatively weak compared to my Swift, but I was able to put together a minimal solution that works across browsers. Not sure if you'd like to do anything with it but I can confirm that this works in Chrome, Firefox, and Safari, all of the colors looking approximately how I would want them to render.
<html lang="en">
<head>
<style>
body {
display: flex;
}
.gradient-text {
font-size: 50px; /* Adjust as needed */
font-weight: bold;
background: linear-gradient(to right, #3b82f6, #9333ea, #f472b6, #fb923c);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text; /* For Firefox */
color: transparent; /* Fallback for browsers that do not support text-fill-color */
}
</style>
</head>
<body>
<div class="gradient-text">Plinky</div>
</body>
</html>
from ignite.
@twostraws: How about adding a style
(conforming to HeadElement
) to allow injecting such customization classes?
Either "structured" (e.g. distinction between rules for class and tags) or just "raw" (e.g. just the style tag with the content as shown above).
from ignite.
@mergesort I looked into how it might work too, and although the CSS itself seems straightforward I'm not really knowledgeable enough to know the full range of how it works. That is, while we could make it work easily enough for one example, what happens if folks apply it to other elements that we hadn't tried? I'd certainly be interested to see some PRs from folks who know this particular piece of CSS better than I do!
from ignite.
@pd95 I suspect the right way to do that particular thing is by adding custom stylesheet into the theme using MetaLink
, then placing it in the Assets folder.
from ignite.
Related Issues (20)
- Deploy & Build error when install Ignite HOT 1
- Build Error on Linux HOT 2
- `addCustomAttribute` not working on `MetaLink`s
- Feature Request: Add capability to make links open their targets in new browser tabs. HOT 3
- To explore: How simple can Ignite sites be?
- Close Button
- Full documentation missing HOT 2
- Adding localization support to improve accessibility HOT 12
- Change to `enum Target` for `case blank` HOT 2
- Swift 6 build fails HOT 5
- Getting warnings about swift-driver
- Support custom install locations in Makefile
- Question: supporting alternative css frameworks, such as tailwindcss HOT 3
- Feature / Image Content Mode HOT 1
- Simple line breaks in markdown or using `Text()` HOT 4
- Feature Request: add Ignite to Homebrew
- Potential Workflow Improving Changes HOT 4
- Is it possible to add multiple items to a NavigationBar logo? HOT 1
- Bug: < and > are removed in markdown code snippets HOT 3
- How to make a whole card or image as a link? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ignite.