Skip to content

🎥 Make videos programmatically with React

better styles

Jonny Burgerb4154496234f
diff --git a/packages/cli/src/editor/components/EditorGuides/Guide.tsx b/packages/cli/src/editor/components/EditorGuides/Guide.tsx
index adf29faabe..89d7163766 100644
--- a/packages/cli/src/editor/components/EditorGuides/Guide.tsx
+++ b/packages/cli/src/editor/components/EditorGuides/Guide.tsx
@@ -1,4 +1,5 @@
import {memo, useCallback, useContext, useMemo} from 'react';
+import {truthy} from '../../../truthy';
import type {Guide} from '../../state/editor-guides';
import {
EditorShowGuidesContext,
@@ -23,7 +24,8 @@ const GuideComp: React.FC<{
const {
shouldCreateGuideRef,
setGuidesList,
- setSelectedGuideId: setSelectedGuideIndex,
+ setSelectedGuideId,
+ selectedGuideId,
} = useContext(EditorShowGuidesContext);
const isVerticalGuide = guide.orientation === 'vertical';
@@ -65,9 +67,9 @@ const GuideComp: React.FC<{
shouldCreateGuideRef.current = true;
document.body.style.cursor = 'no-drop';
- setSelectedGuideIndex(() => guide.id);
+ setSelectedGuideId(() => guide.id);
},
- [shouldCreateGuideRef, setSelectedGuideIndex, guide.id],
+ [shouldCreateGuideRef, setSelectedGuideId, guide.id],
);
const values = useMemo((): ComboboxValue[] => {
@@ -103,7 +105,14 @@ const GuideComp: React.FC<{
>
<div
style={guideContentStyle}
- className="__remotion_editor_guide_content"
+ className={[
+ '__remotion_editor_guide_content',
+ selectedGuideId === guide.id
+ ? '__remotion_editor_guide_selected'
+ : null,
+ ]
+ .filter(truthy)
+ .join(' ')}
/>
</div>
</ContextMenu>
diff --git a/packages/cli/styles/styles.css b/packages/cli/styles/styles.css
index 5cb927458d..f292f87735 100644
--- a/packages/cli/styles/styles.css
+++ b/packages/cli/styles/styles.css
@@ -125,6 +125,7 @@ input[type='color'].__remotion_color_picker::-webkit-color-swatch {
.__remotion_editor_guide_content {
background: #7e1219;
}
-.__remotion_editor_guide:hover .__remotion_editor_guide_content {
+.__remotion_editor_guide:hover .__remotion_editor_guide_content,
+.__remotion_editor_guide_selected {
background: #d22d3a;
}