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

How to change line-height? #202

Open
AshtonScalise opened this issue Nov 18, 2024 · 2 comments
Open

How to change line-height? #202

AshtonScalise opened this issue Nov 18, 2024 · 2 comments

Comments

@AshtonScalise
Copy link

AshtonScalise commented Nov 18, 2024

Throwing a lot of chatgpt's suggestions, can't seem to actually get the amount of tr's I get on my screen (always 40) even when i change all these values, basically I just want an extremely compact view

const newStyles = {
  diffContainer: {
    height: "auto",
    maxHeight: "none",
    overflowY: "auto",
  },
  line: {
    padding: "0 !important",
    margin: "0 !important",
    fontSize: "8px !important",
    lineHeight: "8px !important", // Explicit line height
    height: "8px !important",     // Force height per row
  },
  contentText: {
    fontSize: "8px !important",
    lineHeight: "8px !important",
    padding: "0 !important",
    margin: "0 !important",
  },
  gutter: {
    fontSize: "8px !important",
    padding: "0 !important",
    margin: "0 !important",
  },
};

.react-diff-viewer tr {
  line-height: 8px !important;  /* Explicit line height matching font size */
  padding: 0 !important;        /* Remove all internal padding */
}

.react-diff-viewer td {
  padding: 0 !important;        /* Ensure no padding inside table data */
  height: 8px !important;       /* Match height to font size */
  margin: 0 !important;         /* Remove extra margin */
}
@AshtonScalise
Copy link
Author

Okay after sleeping on it, realized I could just apply transform scale to the container

@zystudios
Copy link

    height: 10px;
    overflow: hidden;
    display: block;       // change display

@AshtonScalise TR can not directly set the height, this is a form property decision, you can change the tr display, like: display: block;

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

No branches or pull requests

2 participants