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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

No type information for styles inside [theme.breakpoints.down()] object #34387

Open
2 tasks done
MariaSolOs opened this issue Sep 20, 2022 · 3 comments
Open
2 tasks done
Assignees
Labels
status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it typescript

Comments

@MariaSolOs
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 馃暪

Steps:

  1. Write the following styled button:
export const StyledButton = styled('button')(({ theme }) => ({
    width: '100%',

    [theme.breakpoints.down('md')]: {
    }
}));
  1. Start writing width: 50% inside the [theme.breakpoints.down('md')] styles. Notice how there are no CSS completions such as the ones provided outside that object.

Current behavior 馃槸

No CSS completions inside [theme.breakpoints.down('XX')] objects.

Expected behavior 馃

CSS completions are always displayed when using styled.

Context 馃敠

No response

Your environment 馃寧

npx @mui/envinfo
  Browser used: Chrome

  System:
    OS: macOS 12.6
  Binaries:
    Node: 16.17.0 - /private/var/folders/kq/jlq8006j7tg9d32d8frd8w800000gn/T/xfs-69364989/node
    Yarn: 3.2.3 - /private/var/folders/kq/jlq8006j7tg9d32d8frd8w800000gn/T/xfs-69364989/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Edge: Not Found
    Firefox: Not Found
    Safari: 16.0
tsconfig.json file
    {
    "include": [
        "next-env.d.ts",
        "next.config.mjs",
        "**/*.ts",
        "**/*.tsx"
    ],
    "exclude": [
        "node_modules"
    ],
    "compilerOptions": {
        // Type checking
        "allowUnreachableCode": false,
        "allowUnusedLabels": false,
        "noFallthroughCasesInSwitch": true,
        "noImplicitAny": true,
        "noImplicitOverride": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "noPropertyAccessFromIndexSignature": true,
        "noUncheckedIndexedAccess": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "strict": true,

        // Modules
        "module": "esnext",
        "moduleResolution": "nodenext",
        "resolveJsonModule": true,

        // Emit
        "importHelpers": true,
        "importsNotUsedAsValues": "error",
        "removeComments": true,
        "sourceMap": true,
        "noEmit": true,

        // JS support
        "allowJs": true,
        "checkJs": true,

        // Interop constraints
        "esModuleInterop": true,
        "isolatedModules": true,
        "forceConsistentCasingInFileNames": true,

        // Language and environment
        "target": "ESNext",
        "jsx": "preserve",
        "lib": [
            "dom",
            "dom.iterable",
            "esnext"
        ],

        // Projects
        "incremental": true,

        // Completeness
        "skipLibCheck": true
    }
}
@MariaSolOs MariaSolOs added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 20, 2022
@siriwatknp
Copy link
Member

From what I checked, it does not work but I am not sure if this should be considered a bug or a new feature as we have experienced a typescript performance issue.

@mnajdova
Copy link
Member

I am aware of this issue, I am pretty sure it has been reported before, but couldn't find the issue. The broken autocomplete comes from the unknown type added in #26228. This was needed in order to make the interoperability between @mui/styles & @mui/styled-engine. We may be able to drop these in v6 if we decide to drop the compatibility between the two.

@mnajdova mnajdova added status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 21, 2022
@mnajdova mnajdova added this to the v6 milestone Sep 21, 2022
@MariaSolOs
Copy link
Author

@mnajdova That would be great!

@DiegoAndai DiegoAndai removed this from the Material UI: v6 milestone Dec 12, 2023
@DiegoAndai DiegoAndai removed the v6.x label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it typescript
Projects
Status: Backlog
Development

No branches or pull requests

5 participants