Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitee8eb53

Browse files
committed
fix: compactCss on inline styles
1 parent061bb93 commitee8eb53

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

‎TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
declaration for the same prop (unless atomic has important, unless style has
55
important)
66

7-
- compactCss inline style
87
- on selector click, show a new panel with the selector and the matching
98
elements -> allow editing the selector from there, allow adding styles in that
109
selector

‎src/declaration.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface DeclarationProps
2626
matchValue:string;
2727
rule:MatchedStyleRule;
2828
inspected:InspectResult;
29-
disabled?:boolean;
29+
hasLineThrough?:boolean;
3030
}
3131

3232
exportconstcheckboxStyles=css.raw({
@@ -47,7 +47,7 @@ export const Declaration = (props: DeclarationProps) => {
4747
inspected,
4848
override,
4949
setOverride,
50-
disabled,
50+
hasLineThrough,
5151
isRemovable,
5252
refresh,
5353
}=props;
@@ -86,7 +86,9 @@ export const Declaration = (props: DeclarationProps) => {
8686
mr="2"
8787
// var(--sys-color-state-hover-on-subtle)
8888
_hover={{backgroundColor:"rgba(253, 252, 251, 0.1)"}}
89-
textDecoration={enabled&&!disabled ?"none" :"line-through !important"}
89+
textDecoration={
90+
!enabled||hasLineThrough ?"line-through !important" :"none"
91+
}
9092
data-declaration={index}
9193
>
9294
<input

‎src/insert-inline-row.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import { symbols } from "./lib/symbols";
1515
import{OverrideMap}from"./devtools-types";
1616
import{Declaration}from"./declaration";
1717
import{useDevtoolsContext}from"./devtools-context";
18-
import{dashCase}from"@pandacss/shared";
18+
import{camelCaseProperty,dashCase}from"@pandacss/shared";
19+
import{compactCSS}from"./lib/compact-css";
20+
import{pick}from"./lib/pick";
1921

2022
interfaceInsertInlineRowProps{
2123
inspected:InspectResult;
@@ -300,7 +302,14 @@ export const InsertInlineRow = (props: InsertInlineRowProps) => {
300302
</Flex>
301303
);
302304

303-
constapplied=Object.fromEntries(inspected.styleEntries);
305+
conststyles=Object.fromEntries(
306+
inspected.styleEntries.map(([prop,value])=>[
307+
camelCaseProperty(prop),
308+
value,
309+
])
310+
);
311+
constkeys=compactCSS(styles);
312+
constapplied=pick(styles,keys.pick);
304313

305314
return(
306315
<Flex
@@ -354,7 +363,9 @@ export const InsertInlineRow = (props: InsertInlineRowProps) => {
354363
source:symbols.inlineStyleSelector,
355364
},
356365
inspected,
357-
disabled:applied[prop]!==value||isAppliedLater,
366+
hasLineThrough:
367+
applied[camelCaseProperty(prop)]!==value||
368+
isAppliedLater,
358369
isRemovable:true,
359370
refresh:refresh,
360371
override:overrides?.[key]??null,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp