Is it possible to remove the color change from the Angular Material Pagination select?

While using md-table-pagination in Angular Material, I am facing an issue where the color of the selected page changes from white to black every time I click on a desired row per page. Is there a way to make sure that the label stays white even after clicking? I tried adjusting the label properties, but it only changed the color of the label itself and not the one after clicking. https://i.sstatic.net/40Gno.png

</md-table-container>
      <md-table-pagination md-limit="$ctrl.query.limit" md-limit-options="$ctrl.query.limitOptions"  md-page="$ctrl.query.page" md-total="{{$ctrl.fullDataList.length}}" md-on-paginate="$ctrl.onPaginate" md-page-select></md-table-pagination>
    </md-table-container>
.md-table-pagination {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: flex-end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  -webkit-flex-wrap: wrap-reverse;
      -ms-flex-wrap: wrap-reverse;
          flex-wrap: wrap-reverse;
  box-sizing: border-box;
  padding: 0 24px;
  font-size: 12px;
  color: $font-color;
  border-top: 1px rgba(0, 0, 0, 0.12) solid;
}
.md-table-pagination md-select {
  -webkit-justify-content: flex-end;
      -ms-flex-pack: end;
          justify-content: flex-end;
  min-width: 64px;
}
.md-table-pagination md-select:not([disabled]):focus .md-select-value {
  color: rgba(0, 0, 0, 0.54);
}
.md-table-pagination md-select .md-select-value {
  -webkit-flex: 0 0 auto;
      -ms-flex: 0 0 auto;
          flex: 0 0 auto;
}
.md-table-pagination md-select .md-select-value span.md-select-icon {
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  text-align: center;
  margin-right: -6px !important;
}
.md-table-pagination md-select .md-select-value span.md-select-icon:after {
  top: initial;
  -webkit-transform: scaleY(0.5) scaleX(1);
          transform: scaleY(0.5) scaleX(1);
}
.md-table-pagination > * {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  height: 56px;
}
.md-table-pagination > .buttons:not(:first-child),
.md-table-pagination > .limit-select:not(:first-child) {
  margin-left: 32px;
}
.md-table-pagination > .buttons {
  margin-right: -16px;
}
.md-table-pagination > .buttons > .md-button.md-icon-button {
  margin: 0;
}
.md-table-pagination > .buttons > .label + .md-button.md-icon-button {
  margin-left: 20px;
}

Answer №1

When dealing with Angular 5 and the need to customize pagination options and selections, consider the following code snippet:

::ng-deep mat-option {
  background: COLOR1 !important;
  // color: white !important;
}

::ng-deep mat-option.mat-selected {
  background: COLOR2 !important;
  color: white !important;
}

Answer №2

When using md-table-pagination, the color of md-select can be customized to your preference. In my case, I adjusted the default black color to white for a better contrast.

This customization allows for a more personalized user experience and enhances the overall design of the select element.

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

Unable to modify SVG color to a white hue

I am currently working on an Angular project where I am utilizing SVG to display some icons. These icons originally have a default grey color, but I want them to change to white when hovered over. Interestingly, while changing the color to red, green, or y ...

Is the table column width determined by the width of the data it contains?

I need to create a table with three columns. The last two columns should adjust their width according to the content they contain, leaving the remaining space for the first column (which has 100% width). Any suggestions on how to achieve this using CSS? C ...

Adjacent buttons

I am trying to place two buttons side by side, but they keep appearing stacked on top of each other. Can anyone help me figure out how to solve this? Here's the code: Styling (CSS): <style type="text/css"> .button_example{ border:1px solid #B ...

Methods for showcasing Array values by utilizing a timeout function

In the array below, I have a list of values: var pages = [{“page”:”url1”,”time”:”20”}, {"page":"url2”,”time”:”25”}, {"page":"url3”,”time”:”10”}, {"page":"url4”,,”time”:”12”}, {"page":"url5”, ...

Tips for showcasing a lineup horizontally with HTML and CSS

I'm currently working on creating a menu using HTML. I've included my links in an unordered list (ul) as shown below. In my CSS, I added a display:inline; property to the links to make them appear side by side like a menu. However, for some reaso ...

AngularJS: Render the initial element of the result set array

Currently, I have a form that consists of two dynamic dropdowns - one for selecting the location and the other for choosing the branch. When a location is selected, the corresponding branches for that location will be automatically displayed in the Branch ...

Tips on relocating the input position to the top

Currently, I have a text input that is centered horizontally when typing text. However, I want it to be positioned at the top instead. See the following code: height: 143px; width: 782px; font-family: 'Roboto Mono'; background: #FFFFFF; border ...

Troubleshooting problems with displaying views due to asynchronous $http.get calls in AngularJS

Within my application, I am utilizing two separate API calls. The initial call retrieves a catalog of services along with their unique ID's. Subsequently, once the ID information is acquired, a second call is made to retrieve pricing data for each cor ...

caption sliding into the incorrect div box

As I continue my journey of learning CSS, I've encountered a puzzling issue involving slide-in captions within a different div element. The problem arises when I try to customize the appearance of the caption to better fit the overall design of my web ...

What is the best way to format or delete text enclosed in quotation marks within an anchor tag using CSS or JavaScript?

I have encountered an issue with a dynamically generated login form. When I select the 'Forgot Password' option, a new 'Back to Login' message appears along with a separating '|' line. Removing this line is proving challenging ...

Tips for refreshing information in the Angular front-end Grid system?

I am currently working with the Angular UI Grid. The HTML code snippet in my file looks like this. <div ui-grid="gridOptions"></div> In my controller, I have the following JavaScript code. $scope.values = [{ id: 0, name: 'Erik&a ...

Setting the height of a div using CSS and navigating between views using Angular UI

Issue One: When moving one square, the border should appear and the menu should cover the entire height. I've already spent 2 hours trying to fix this, but it still doesn't fill the whole height or center vertically. Problem Two: If you make the ...

What steps should be taken for the authentication process when using Active Directory (with LDAP) with an AngularJS/JavaScript frontend?

Currently, I am tackling a project that involves authenticating users in an application using their Windows credentials. The frontend is built with AngularJS and the backend with Java. After conducting extensive research, I came to the realization that it ...

Having difficulty injecting a factory into a controller in AngularJS

I'm currently restructuring my angular code by utilizing factories to prevent my controllers from becoming unmanageable. I plan on storing code in the factory that will be shared among various controllers. Despite my efforts, I'm facing difficul ...

Click event triggers dynamic function call

Is it possible to have different functions for ng-click depending on the loaded controller page? <a ng-click="removeEvent(event)" class="top_menu_link"> REMOVE</a> For instance, if I want the same button to trigger a remove action but on diff ...

SVG Height remains fixed despite aspect ratio adjustments

Using one SVG image in a div with a width of 50px results in a height of 150px in IE11. The correct dimensions should be 50px x 50px. The width is applied correctly, but the height is not. Any suggestions? .svg-cont{ width:50px } img{ max-width:100% ...

What might be causing Flex not to function properly on my personalized landing page?

I attempted to create a basic landing page featuring an image background with a logo, button, and a row of 4 images displayed side by side using Flex. However, for some reason, the Flex is not functioning properly for the row of images. Here is the code s ...

I am facing an issue with localStorage.clear() not functioning properly in Internet Explorer when using Protractor

Having trouble clearing localStorage at the beginning of each test, specifically in Internet Explorer 11. This issue does not occur in Chrome or Firefox. Below are the codes we have tested: browser.executeScript('window.localStorage.clear();'); ...

Design a hover zone that allows for interaction without disrupting click events

I am looking to create a tooltip box that appears when hovering over an element, and I want the tooltip to only disappear when the user's mouse exits a specific custom hover area outlined by a vector graphic. My current implementation is working, but ...

Failed to create Angular controller instance

I need help setting up a basic login feature using AngularJS. Here is my current code: <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>H ...