question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Allow adding css styles to various parts of component

See original GitHub issue

First of all: Thank you for this great component. It saved me a lot of work! I am not so experienced with CSS and SCSS but can survive. So I ran into a situation where I need help.

Is your feature request related to a problem? Please describe. I am using the AdminLTE Styling template for a Blazored Application with many pages and of course
blazored.typeahead. The Problem is, typehead styling does not fit with AdminLTE. Positioning the search filed seems to not an easy one, especially the height of input field. Even more, if it comes to media targeted design thing get complicated. However, I don’t want to rework all styles and copy paste the ones from bootstrap or AdminLTE into typeahead stale sheet.

Describe the solution you’d like It would be great have a possibility to add css classes to the elements in typeahead component through parameters or break apart the component into child components like in blazored menu.

Describe alternatives you’ve considered I tried to overcome the styling issue using scss @extend and @mixin but that did not work. At the end I cloned the project and added the classes I need. This seems to be not an ultimate solution, because I suspect I loose future enhancements of the component.

Additional context Code snippet what I have done:

@typeparm TItem
@typeparam TValue
<div class="blazored-typeahead @FieldCssClasses">

    <div class="blazored-typeahead__controls form-control form-control-sm">

        @if (Disabled)
        {

There are more such things like the shadow around the input field and the way focus is styled.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
vertonghenbcommented, Apr 13, 2020

A workaround:

Add the styling directly to the predefined css classes.

Solution

We can simply add a Class parameter and add the classes to the list of css classes in the control. The user is then responsible for the overwrite.

0reactions
digitalsigicommented, Apr 14, 2020

Sounds good. I think, if one wants to change it, it should be possible. I experienced already, that this is not easy doing and requires good knowledge of css. @Workaround: Did not work for me, because I am using the scss templates bootstrap and AdminLTE (yes, I know, not Javascript free) and their responsive design. It was easier to fork the project and change the code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding CSS to page components | Kentico 11 Documentation
If the Combine CSS from components setting is enabled, pages bundle the loading of CSS styles of all contained components into a single...
Read more >
FEATURE REQUEST: In-Built Styling System
I want to style the Form created with Frontend Admin (your plugin), but the only way I see available for now, is to...
Read more >
Apply CSS — Panel v1.2.1
This guide addresses how to apply custom CSS styling to components. ... Applying styles allows us to style the container in a straightforward...
Read more >
Styling Web Components Using A Shared Style Sheet
There are three techniques you can use today that will allow a web component to share styles: @import , custom elements and a...
Read more >
Different Ways to Write CSS in React
First, create an object that contains styles for different elements. Then add it to an element using the style attribute and then select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found