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

WIP: library: add CSS Gradient entry #647

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/Library/demos/CSS Gradient/main.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Gtk 4.0;
using Adw 1;

Adw.StatusPage {
title: "CSS Gradient";
description: _("Give Gtk widgets a psychedelic touch");

Box {
orientation: vertical;
halign: center;

Button regular {
name: "primary";
label: "Regular";
styles ["pill", "psychedelic-pill"]
}
}
styles ["psychedelic-bg"]
}

17 changes: 17 additions & 0 deletions src/Library/demos/CSS Gradient/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* A static gradient background for the outer box */
.psychedelic-bg {
background: linear-gradient(15deg, #001430, #242424, #140000);
background-size: 100% 100%;
}
/* The top window borders are normally removed if psychedelic-bg is used on the whole window */
.psychedelic-bg headerbar {
border: none;
box-shadow: none;
}

/* A rainbow sliding gradient for the pill widget itself */
.psychedelic-pill{
background: linear-gradient(-45deg, #ed7650, #e5307f, #24a4d2, #24d8af);
background-size: 400% 400%;
animation: gradient 15s ease infinite;
}
6 changes: 6 additions & 0 deletions src/Library/demos/CSS Gradient/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"category": "controls",
"description": "Add an animated CSS gradient to spice up your widgets",
"panels": ["ui", "preview"],
"autorun": true
}