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

Using tabs with colors underlines all tab sections #791

Open
nip1904 opened this issue Jan 27, 2025 · 2 comments
Open

Using tabs with colors underlines all tab sections #791

nip1904 opened this issue Jan 27, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@nip1904
Copy link

nip1904 commented Jan 27, 2025

Introduction

When I use the tab component and add colors to the tab. All tabs are underlined and so setting active/inactive is not possible.

To Reproduce

List of steps to reproduce the behavior. Include the sql file you are using and the eventual relevant parts of your database schema

select
   'tab'             as component;
select 
   'calendar-week'   as icon,
   '2023'            as title;
select   
   'calendar-week'   as icon,
   '2024'            as title,
   TRUE              as active;
select 
   'calendar-week'   as icon,
   '2025'            as title;
--
select
   'tab'             as component;
select 
   'calendar-week'   as icon,
   'red'             as color,
   '2023'            as title;
select   
   'calendar-week'   as icon,
   '2024'            as title,
   'green'           as color,
   TRUE              as active;
select 
   'calendar-week'   as icon,
   'yellow'          as color,
   '2025'            as title;

Actual behavior

After following these steps, what happened ?
If you saw an error on the command line or inside your page, then paste it here

your error message here

Screenshots

If applicable, add screenshots to help explain your problem.

Image

Expected behavior

A clear and concise description of what you expected to happen.

Version information

  • OS:
  • Database [e.g. SQLite, Postgres]
  • SQLPage Version [found when hovering the default footer of pages]:

Additional context

Add any other context about the problem here.

@nip1904 nip1904 added the bug Something isn't working label Jan 27, 2025
@lovasoa
Copy link
Collaborator

lovasoa commented Jan 27, 2025

Hi !

Indeed, the curent documentation is misleading. But what you are trying to do is possible with

select
   'tab'             as component;
select 
   'calendar-week' as icon,
   '2023' as title,
   case $tab when '2023' then 'red' end as color;
select   
   'calendar-week'   as icon,
   '2024' as title,
   case $tab when '2024' then 'green' end as color;
select 
   'calendar-week'   as icon,
   '2025' as title,
   case $tab when '2025' then 'yellow' end as color;
Screencast.From.2025-01-27.10-03-56.mp4

Setting a color with the color property unconditionally applies the color. But if you need a condition, you can express it in sql.

@nip1904
Copy link
Author

nip1904 commented Jan 28, 2025

Hi, yes I did this workaround already.
I did not know if it is a bug or works a designed.

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

No branches or pull requests

2 participants