ng-bootstrap's accordion imparts unique style to its child icons

https://i.sstatic.net/YzmtN.png

Visible star icon indicates lack of focus on the accordion

https://i.sstatic.net/aNW31.png

Star disappears when accordion gains focus

Below is the CSS code I used to position the star to the left of the accordion:

.icon-star2.relevant-source {
  position: absolute;
  margin-left: -5em;
}

Here's an example of the coded markup (with placeholder variables):

 <ngb-accordion class="accordion accordion-alternate">
           <ngb-panel class="source-accordion" *ngFor="x">
                            <ng-template ngbPanelTitle>
                                <i *ngIf="x > 0" class="icon-star2 relevant-source"
                                   title="This source contains {{x}} of the top 10 most relevant documents.">
                                </i>
                                <span class="source-link source-link-text">{{x}}</span><span class="float-right source-link">
                                {{x | number:0 }}</span>
                            </ng-template>
                            <ng-template ngbPanelContent>
                                List of documents
                            </ng-template>
                        </ngb-panel>
                    </ngb-accordion>

The main objective is to display a starred element alongside specific accordion items, complete with a tooltip. However, there seem to be challenges in achieving this. Any suggestions or solutions would be greatly appreciated.

Answer №1

experiment using deep

/deep/ ngb-accordion > ngb-panel> i.icon-star2.relevant-source{
 position: absolute;
 margin-left: -5em;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize $.get AJAX to extract data from a multidimensional JSON array

Struggling to make two functions work on my form that uses AJAX and jQuery to look up an array. One function is functional while the other seems to be causing confusion with over-analysis and extensive troubleshooting. Any insights into what may be missing ...

Validate with JavaScript, then display and submit

I've created a submit function to verify form inputs, and then, if desired (via checkbox), print as part of the submission process. The issue is that when printing, the form submission never finishes. However, without printing, the form submits corre ...

Text included in the body of an email sent through Outlook

Whenever I click on a specific button, it opens Outlook with the provided details. Additionally, there is a TEXTAREA element containing certain texts. Is there a way to display this text in the body of my Outlook email? Below is the sample code - & ...

Facing continuous 404 errors while working with nodejs and express

While attempting to collect data from a local host webpage's registration form that captures user information, I encounter an issue upon pressing the submit button A 404 Error is displayed stating "page not found", preventing the collection and out ...

Troubleshooting image overlay alignment concerns

My script successfully adds the image src to the overlay's image, but I encounter a problem when creating the variable imgH for the margin-top value. It calculates the image's height and divides it in half. The issue arises when the calculated h ...

What is the best way to ensure that my top menu remains fixed while scrolling?

Link to website: I am looking to have the top menu on my page remain fixed at the top of the screen as users scroll. Does anyone know if this is achievable, and if so, how can I implement it? ...

Nav Bar Toggle Button - Refuses to display the dropdown menus

My Django homepage features a Bootstrap navbar that, when resized, displays a toggle button. However, I am experiencing difficulty with dropdown functionality for the navbar items once the toggle button is activated. Can anyone provide guidance on how to a ...

What is the best way to set up secure client routes?

Welcome to my College Dashboard Project! :) I am currently utilizing Next.js to create a comprehensive dashboard system for Teachers, Students, and Administrators. The Home page serves as the central hub for logging in or signing up as any of the mention ...

Sending a file using Angular's $http service

I am facing an issue while trying to upload a form with an image file using the angular $http function and multer in the background for receiving. I have successfully uploaded the image via a direct form submission (without angular) as shown below: <fo ...

Is there a way to obtain two different colors from a single color?

Is there a way to use a method that displays two different colored borders in a specific color? Is it possible to implement this using PHP or jQuery? Apologies for my poor English Thank you, Rory McCrossan ...

What is the process for obtaining a custom slot in a v-data-iterator?

How can I customize the slot in v-data-iterator to change the color and content of certain sections? Desired Customization: https://i.sstatic.net/bqdfL.jpg This is what I have tried so far: <!-- Custom slot for Calories --> ...

Why does Angular not reset form after ng-click event?

Something seems off with my form reset after a ng-click event, am I missing something? I can successfully submit the form, but it doesn't automatically reset. Here is the error message I receive: angular.js:12701 POST 500 (Internal Server Error ...

What is the method for adjusting the position of materialize CSS select options?

https://i.stack.imgur.com/b9p9T.png One issue arises when I open the Materialize CSS select, as the options end up covering the input. Ideally, I prefer the options to appear underneath the input. <div class="input-field "> ...

Is it possible to modify or delete the question mark in a URL?

Currently, I am working on implementing a search bar for one of my websites hosted on Github. Below is the code I have written for the search bar: <!-- HTML for SEARCH BAR --> <div id="header"> <form id="newsearch" method ...

How can I prevent users from selecting text when they right click using JavaScript?

My custom context menu on canvas works well, but I'm facing an issue with Text elements. When I try to right-click on a text element, it triggers text selection as if double-clicking. I attempted to use the following code: document.addEventListener(& ...

Switch the following line utilizing a regular expression

Currently, I am facing a challenge with a large file that needs translation for the WordPress LocoTranslate plugin. Specifically, I need to translate the content within the msgstr quotes based on the content in the msgid quotes. An example of this is: #: . ...

What is the best way to access nested objects in React Native?

Here is the JSON data I am working with: [ { id: 51, name: 'Boat Neck Blouse', image: { id: 669, date_created: '2018-08-27T10:05:39', date_created_gmt: '2018-08-27T10:05:39', date_modified ...

Are several UDP sockets open across various ports?

I'm trying to get the port of a receiving server using the following code snippet: var dgram = require("dgram"); var start = 27015; for(var i = start; i < (start + 100); i++) { var server = dgram.createSocket("udp4"); server.on("message ...

Difficulty displaying a 2D SVG in Three.js and WebGL

I am struggling to incorporate my own SVG illustration into a ThreeJS Scene that already contains a cat object and a cube. I have tried using resources like the CodePen (link included) and various Stack Overflow threads related to LegacySVG Loader, but I f ...

Implement a uniform CSS design across all elements within an Angular 2 application

I am trying to make use of some basic and reusable CSS rules in my Angular application, such as: .ng-invalid { border-left: 5px solid #a94442; } .ng-valid { border-left: 5px solid #42A948; } However, I want these rules to be applied to all compo ...