Skip to content

Commit e37e8fa

Browse files
committed
fix(css): typedef issue(#50)
1 parent 347722a commit e37e8fa

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

packages/core/src/helper/css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { BaseContext } from '../styled'
22
import type { ExpressionType } from '../utils'
33
import { insertExpressions } from '../utils'
44

5-
export function css<T = BaseContext<any>>(
5+
export function css<T = BaseContext<object & { [key: string]: any }>>(
66
strings: TemplateStringsArray,
77
...interpolations: (ExpressionType<T> | ExpressionType<T>[])[]
88
): ExpressionType<T>[] {

packages/playground/src/App.vue

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import styled, { css, ThemeProvider } from '../../core/dist'
2+
import styled, { css, ThemeProvider } from '@vue-styled-components/core'
33
import { reactive, ref, computed, onMounted, onUnmounted } from 'vue'
44
import PerformancePanel from './components/PerformancePanel.vue'
55
import BasicTests from './components/BasicTests.vue'
@@ -78,21 +78,12 @@ const Sidebar = styled.aside`
7878
padding: 1rem;
7979
`
8080
81-
82-
const cs = css`
81+
const TabButton = styled.button<{ active: boolean }>`
8382
width: 100%;
8483
padding: 0.75rem 1rem;
8584
margin-bottom: 0.5rem;
8685
background: ${props => props.active ? 'rgba(255, 255, 255, 0.2)' : 'transparent'};
8786
color: white;
88-
`
89-
90-
const TabButton = styled.button<{ active: boolean }>`
91-
width: 100%;
92-
padding: 0.75rem 1rem;
93-
margin-bottom: 0.5rem;
94-
background: ${props => props.theme.active ? 'rgba(255, 255, 255, 0.2)' : 'transparent'};
95-
color: ${props => props.theme.background};
9687
border: 1px solid ${props => props.active ? 'rgba(255, 255, 255, 0.3)' : 'rgba(255, 255, 255, 0.1)'};
9788
border-radius: 8px;
9889
cursor: pointer;

0 commit comments

Comments
 (0)