table.css 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright 2021-2024 Avaiga Private Limited
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  5. * the License. You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  10. * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  11. * specific language governing permissions and limitations under the License.
  12. */
  13. /**************************************************************
  14. TABLE
  15. ***************************************************************/
  16. :root {
  17. --table-stripe-opacity: 0.5;
  18. }
  19. /*************************************************
  20. NORMALIZATION
  21. **************************************************/
  22. .taipy-table {
  23. position: relative;
  24. max-width: 100%;
  25. z-index: 0; /* Fix table sticky header going above app fixed header on scroll */
  26. }
  27. .card .taipy-table .MuiPaper-elevation {
  28. box-shadow: none;
  29. }
  30. /*************************************************
  31. OVERRIDES/RESET CLASSES
  32. Give a softer look to default tables with, but allow resetting MUI defaults with classes
  33. **************************************************/
  34. /* Soft header on rows as Stylekit default */
  35. /* "header-plain" class to return to MUI default plain header */
  36. .taipy-table:where(:not(.header-plain)) thead th {
  37. background: var(--color-paper);
  38. font-weight: bold;
  39. }
  40. /* No borders on rows as Stylekit default */
  41. /* "rows-bordered" class to return to MUI default rows with borders */
  42. .taipy-table:where(:not(.rows-bordered)) thead th,
  43. .taipy-table:where(:not(.rows-bordered)) tbody td {
  44. border-bottom: none;
  45. }
  46. /* Striped rows as Stylekit default */
  47. /* "rows-similar" to return to MUI default similar looking rows */
  48. .taipy-table:where(:not(.rows-similar)) tbody tr:nth-child(odd) {
  49. position: relative;
  50. z-index: 0;
  51. }
  52. .taipy-table:where(:not(.rows-similar)) tbody tr:nth-child(odd)::after {
  53. content: '';
  54. position: absolute;
  55. top: 0;
  56. left: 0;
  57. z-index: -1;
  58. width: 100%;
  59. height: 100%;
  60. background: var(--color-background);
  61. opacity: var(--table-stripe-opacity, 0.5);
  62. }