Skip to content

Commit

Permalink
Added link specific styles
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Oct 9, 2023
1 parent febb718 commit 1dec259
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 25 deletions.
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation/TopBar/SitePopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function InstanceSettings(): JSX.Element | null {

return (
<Link to={urls.instanceSettings()}>
<LemonButton icon={<IconCorporate className="text-primary" />} onClick={closeSitePopover} fullWidth>
<LemonButton icon={<IconCorporate className="text-link" />} onClick={closeSitePopover} fullWidth>
Instance settings
</LemonButton>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/HoqQLPropertyInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type HoqQLPropertyInfoProps = {

export const HoqQLPropertyInfo = ({ value }: HoqQLPropertyInfoProps): JSX.Element => {
return (
<span title={value} className="font-mono text-primary text-xs">
<span title={value} className="font-mono text-link text-xs">
{midEllipsis(value, 60)}
</span>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function SubscriptionListItem({ subscription, onClick, onDelete }: Subscr
>
<div className="flex justify-between flex-auto items-center p-2">
<div>
<div className="text-primary font-medium">{subscription.title}</div>
<div className="text-link font-medium">{subscription.title}</div>
<div className="text-sm text-default">{capitalizeFirstLetter(subscription.summary)}</div>
</div>
{subscription.target_type === 'email' ? (
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/lemon-ui/LemonTabs/LemonTabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
height: 0.125rem;
width: var(--lemon-tabs-slider-width);
transform: translateX(var(--lemon-tabs-slider-offset));
background: var(--primary);
background: var(--link);
.LemonTabs--transitioning & {
transition: width 200ms ease, transform 200ms ease;
}
Expand All @@ -48,13 +48,13 @@
margin-right: 2rem;
}
&:hover {
color: var(--primary);
color: var(--link);
}
&:active {
color: var(--primary-dark);
}
&.LemonTabs__tab--active {
color: var(--primary);
color: var(--link);
text-shadow: 0 0 0.25px currentColor; // Simulate increased weight without affecting width
}
a {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/lemon-ui/Link/Link.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.Link {
transition: color 200ms ease, opacity 200ms ease;
background: none;
color: var(--primary);
color: var(--link);
border: none;
outline: none;
padding: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function ColumnConfigurator({ query, setQuery }: ColumnConfiguratorProps)
<LemonButton
type="secondary"
data-attr="events-table-column-selector"
icon={<IconTuning style={{ color: 'var(--primary)' }} />}
icon={<IconTuning />}
onClick={showModal}
>
Configure columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function SignupLeftContainer(): JSX.Element {
{productBenefits.map((benefit, i) => (
<div className="flex flex-row gap-4 mb-4" key={i}>
<div>
<IconCheckCircleOutline className="mt-2 w-4 h-4 text-primary" />
<IconCheckCircleOutline className="mt-2 w-4 h-4 text-link" />
</div>
<div>
<h3 className="mb-1 font-bold leading-6">{benefit.benefit}</h3>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/billing/BillingLimitInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const BillingLimitInput = ({ product }: { product: BillingProductV2Type }
{!isEditingBillingLimit ? (
<>
<div
className={clsx('cursor-pointer', customLimitUsd && 'text-primary')}
className={clsx('cursor-pointer', customLimitUsd && 'text-link')}
onClick={() => setIsEditingBillingLimit(true)}
>
${customLimitUsd}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function DashboardsTable({
</Link>
{is_shared && (
<Tooltip title="This dashboard is shared publicly.">
<IconShare className="ml-1 text-base text-primary" />
<IconShare className="ml-1 text-base text-link" />
</Tooltip>
)}
{!canEditDashboard && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function RawDefinitionHeader({
const isLink = asLink && fullDetailUrl

const innerContent = (
<span className={clsx('definition-column-name-content-title', asLink && 'text-primary cursor-pointer')}>
<span className={clsx('definition-column-name-content-title', asLink && 'text-link cursor-pointer')}>
<PropertyKeyInfo value={definition.name ?? ''} disablePopover disableIcon />
</span>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Roles({ isRestricted }: RestrictedComponentProps): JSX.Element {
render: function RoleNameRender(_, role) {
return (
<div
className="row-name text-primary cursor-pointer"
className="row-name text-link cursor-pointer"
onClick={() => {
setRoleInFocus(role)
}}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/paths/PathNodeCardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function PathNodeCardButton({
</div>
<div className="flex flex-nowrap">
<LemonButton size="small" status="stealth">
<span className="text-primary text-xs pr-1 font-medium" onClick={openModal}>
<span className="text-link text-xs pr-1 font-medium" onClick={openModal}>
{count}
</span>
</LemonButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ProjectHomePageCompactListItem({
{prefix ? <span className="shrink-0">{prefix}</span> : null}

<div className="truncate space-y-1 flex-1">
<div className="text-primary font-semibold truncate">{title}</div>
<div className="text-link font-semibold truncate">{title}</div>
<div className="truncate text-default font-normal">{subtitle}</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ export function PlayerController(): JSX.Element {
}}
>
<IconSkipInactivity
className={clsx(
'text-2xl',
skipInactivitySetting ? 'text-primary' : 'text-primary-alt'
)}
className={clsx('text-2xl', skipInactivitySetting ? 'text-link' : 'text-primary-alt')}
enabled={skipInactivitySetting}
/>
</LemonButton>
Expand All @@ -100,7 +97,7 @@ export function PlayerController(): JSX.Element {
}}
>
<IconFullScreen
className={clsx('text-2xl', isFullScreen ? 'text-primary' : 'text-primary-alt')}
className={clsx('text-2xl', isFullScreen ? 'text-link' : 'text-primary-alt')}
/>
</LemonButton>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export function SessionRecordingPreview({
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-1 shrink overflow-hidden">
<PinnedIndicator pinnedCount={recording.pinned_count} />
<div className="truncate font-medium text-primary ph-no-capture">
<div className="truncate font-medium text-link ph-no-capture">
{asDisplay(recording.person)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export function SessionRecordingPlaylistItem({
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-1 shrink overflow-hidden">
<PinnedIndicator pinnedCount={recording.pinned_count} />
<div className="truncate font-medium text-primary ph-no-capture">
<div className="truncate font-medium text-link ph-no-capture">
{asDisplay(recording.person)}
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ body {
--glass-bg-3000: var(--bg-light);
--glass-border-3000: var(--border);
--bg-light: #fff;
--link: var(--link-3000);

&.posthog-3000[theme='light'] {
--text-3000: var(--text-3000-light);
Expand All @@ -587,6 +588,7 @@ body {
--glass-bg-3000: var(--glass-bg-3000-light);
--glass-border-3000: var(--glass-border-3000-light);
--bg-light: #fff;
--link-3000: var(--link-3000-light);
}

&.posthog-3000[theme='dark'] {
Expand All @@ -605,6 +607,7 @@ body {
--glass-border-3000: var(--glass-border-3000-dark);
--bg-light: var(--accent-3000);
--brand-key: #fff; // In dark mode the black in PostHog's logo is replaced with white for proper contrast
--link-3000: var(--link-3000-dark);
}

&.posthog-3000 {
Expand Down Expand Up @@ -661,6 +664,10 @@ body {
font-family: var(--font-mono);
}

a {
color: var(--link);
}

// AntD uses its own border color for the bottom of tab lists, but we want to use `var(--border)`
.ant-tabs-top,
.ant-tabs-bottom {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/styles/utilities.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Overview = (): JSX.Element => {
<div className="text-lg font-bold">Hello there!</div>
<div className="text-sm">
I'm an example of how you can use utility classes to build a{' '}
<span className="text-primary">complex component</span> without any custom CSS...
<span className="text-link">complex component</span> without any custom CSS...
</div>
</div>

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/styles/vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $colors: (
'border-bold': rgba(0, 0, 0, 0.24),
'border-active': rgba(0, 0, 0, 0.36),
'transparent': transparent,

'link': var(--link),
// Colors of the PostHog logo
'brand-blue': #1d4aff,
'brand-red': #f54e00,
Expand All @@ -123,7 +123,7 @@ $colors: (
'border-bold-3000-light': #c1c2b9,
'glass-bg-3000-light': #e4e5deb3,
'glass-border-3000-light': #e4e5de,

'link-3000-light': var(--primary),
'text-3000-dark': #fff,
'muted-3000-dark': rgba(#fff, 0.5),
'trace-3000-dark': rgba(#fff, 0.25),
Expand All @@ -137,6 +137,7 @@ $colors: (
'border-bold-3000-dark': #3f4046,
'glass-bg-3000-dark': #1d1f27b3,
'glass-border-3000-dark': var(--border-3000-dark),
'link-3000-dark': rgb(47, 129, 247),
// The derived colors
'text-3000': var(--text-3000),
'muted-3000': var(--muted-3000),
Expand All @@ -151,6 +152,7 @@ $colors: (
'border-bold-3000': var(--border-bold-3000),
'glass-bg-3000': var(--glass-bg-3000),
'glass-border-3000': var(--glass-border-3000),
'link-3000': var(--link-3000),
// 'bg-light': var(--accent-3000),
);

Expand Down

0 comments on commit 1dec259

Please sign in to comment.