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

Add a secondary background color to code blocks #6029

Open
JarWarren opened this issue Jun 26, 2024 · 1 comment
Open

Add a secondary background color to code blocks #6029

JarWarren opened this issue Jun 26, 2024 · 1 comment

Comments

@JarWarren
Copy link
Contributor

Add a secondary background color to inline code blocks

Can we change the background color of code blocks (backticked text) to make it more visibly distinct? The website has this, but the CRM doesn't.

Current behavior

Currently the font and kerning change, but it's easy to miss. The following screenshot contains a code block. This affects both light and dark mode.

Screenshot 2024-06-25 at 7 42 21 PM

Expected behavior

Secondary background color, consistent with the website.

Screenshot 2024-06-25 at 7 45 53 PM
Copy link

greptile-apps bot commented Jun 26, 2024

To add a secondary background color to inline code blocks:

  1. Update BackgroundDark.ts:

    • Add a new color constant for the secondary background.
    export const BACKGROUND_DARK = {
      // existing colors
      codeBlock: '#yourSecondaryColor', // Add this line
    };
  2. Update SecondaryColors.ts:

    • Add a new color constant for the secondary background.
    export const SECONDARY_COLORS = {
      // existing colors
      codeBlock: '#yourSecondaryColor', // Add this line
    };
  3. Update MainButton.tsx:

    • Modify the styled component to apply the new background color to code blocks.
    const StyledButton = styled.button<Pick<Props, 'fullWidth' | 'width' | 'variant'>>`
      // existing styles
      code {
        background: ${({ theme }) => theme.background.codeBlock};
      }
    `;

References

/packages/twenty-front/src/modules/ui/theme/constants/BackgroundDark.ts
/packages/twenty-front/src/modules/ui/theme/constants/SecondaryColors.ts
/packages/twenty-front/src/modules/ui/input/button/components/MainButton.tsx
/packages/twenty-front/src/modules/ui/theme/constants/HoverBackground.ts

Ask Greptile · Edit Issue Bot Settings

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

No branches or pull requests

1 participant