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

🎨 Fix dropdown menu so that active buttons stand out more. #39

Open
JamesAlfonse opened this issue Jan 16, 2025 · 5 comments
Open

🎨 Fix dropdown menu so that active buttons stand out more. #39

JamesAlfonse opened this issue Jan 16, 2025 · 5 comments

Comments

@JamesAlfonse
Copy link
Member

Screenshot 2024-10-20 at 5 31 06 PM

Added readability to these buttons, but have not been able to make progress on adjusting the colors between the active and non-active buttons. The active buttons look like they're pressed in, but adjusting the colors in the css file for the section below does not work. #134F9B should be a blue color. It's possible that there's a conflict between the css code and the datatables library causing this. One solution could be to download the full library and include it in this repository to have more visible control over the styling. Regardless, I would prefer to look at other stack alternatives first before proceeding with this option #8. I will look into fixing the headers next.

/* Styles for active buttons using aria-pressed attribute */

div.dt-button-collection .dt-button[aria-pressed="true"] {

/* Set background color for active buttons */

background-color: #134F9B !important;

/* Set text color for active buttons */

color: #FFFFFF !important;

}

Originally posted by @JamesAlfonse in #17

@JamesAlfonse
Copy link
Member Author

@tehchives mentioned that @jergy2 may be able to assist, tagging for visibility.

@jergy2
Copy link

jergy2 commented Jan 22, 2025

i took a look through the production webpage to see what styles are being applied, though it is a little bit hard to track without seeing the source files for this, as it looks like there are potentially numerous competing style classes that are applying styles to the element.

I noticed for example that there is an active class applied to those menu items. Some styles in that .active class seem to work, for example font-weight: bold, however, background-color does not, as some other class is taking priority for that style. Same with the color property

Image

If you just want the text to stand out a bit, you could simply apply the font-weight: bold to the .active class.

If you specifically want to change the color to blue, then further investigation into the structure of the css will be required to determine where the color property is being and taking priority over the active class

@JamesAlfonse
Copy link
Member Author

Thanks for taking a look @jergy2. The color change would be the ideal long-term adjustment here, but I like the bold text as a short-term change. I had tried using Claude Sonnet and o1 to look for a styling conflict, but had no luck a while back. I think you may be right about the priority being the issue here. Do you think it could be the library used for the buttons, or would it be more likely something within the styles.css file?

@jergy2
Copy link

jergy2 commented Jan 23, 2025

in general, with respect to CSS order of priority:

From a stackoverflow comment:

There are several CSS rules ( applied in this order ) :

1 inline css ( html style attribute ) overrides css rules in style tag and css file
2 a more specific selector takes precedence over a less specific one
3 rules that appear later in the code override earlier rules if both have the same specificity.
4 A css rule with !important always takes precedence.

in this case it appears to be

parent element with class .dt-button-collection
child element .dt-button

with final element applying styles as: .dt-button-collection .dt-button

this is where it is applying the color and background-color properties

it looks like those properties are set using the !important word, which may be the cause of preventing other classes from applying styles to those properties.

Image

@JamesAlfonse
Copy link
Member Author

Thanks for the insightful comment @jergy2. I adjusted the code to remove any instance of "!important" to rule that out. Still running into the same issue, but one step closer to figuring it out.

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

No branches or pull requests

2 participants