-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css] add ':focus-within' pseudo class #41248
Comments
I have
I guess selectors were outside the scope of microsoft/vscode-css-languageservice#68? |
pseudoClasses such as cc: @octref |
@connorshea Yes they are in here: https://github.com/mdn/data/blob/master/css/selectors.json#L202, and we could source the selectors. |
If this hasn't been taken up, I'd like to give it a shot. |
@ely-alamillo Sure! Here are some hints to get you started:
We look forward to your PR 🌟 |
I added some info about mapping pseudo-classes between |
@octref @connorshea Thanks a lot! |
@octref I have been exploring the code and how it all works together and I'm not 100% sure on which part I should put my focus on. I see that generate_browserjs.js is generating the data used in |
@ely-alamillo Sure, here is the instruction for developing css-language-features: https://github.com/Microsoft/vscode/tree/master/extensions/css-language-features Here is how we import data from
When you run You want to do something similar for this file, import its data to complement this section: https://github.com/Microsoft/vscode-css-languageservice/blob/master/src/data/browsers.ts#L86-L474 |
@ely-alamillo Are you still interested in contributing or hitting any blocking issues? We'll need to close this issue by this Friday. |
These new pseudo selectors and elements have been sourced from mdn/data {
pseudoSelectorDescriptions: {
':defined': 'The :defined CSS pseudo-class represents any element that has been defined. This includes any standard element built in to the browser, and custom elements that have been successfully defined (i.e. with the CustomElementRegistry.define() method).',
':dir': 'The :dir() CSS pseudo-class matches elements based on the directionality of the text contained in them.',
':focus-visible': 'The :focus-visible pseudo-class applies while an element matches the :focus pseudo-class and the UA determines via heuristics that the focus should be made evident on the element.',
':focus-within': 'The :focus-within pseudo-class applies to any element for which the :focus pseudo class applies as well as to an element whose descendant in the flat tree (including non-element nodes, such as text nodes) matches the conditions for matching :focus.',
':placeholder-shown': 'The :placeholder-shown CSS pseudo-class represents any <input> or <textarea> element that is currently displaying placeholder text.'
},
pseudoElementDescriptions: {
'::-moz-range-progress': 'The ::-moz-range-progress CSS pseudo-element is a Mozilla extension that represents the lower portion of the track (i.e., groove) in which the indicator slides in an <input> of type="range". This portion corresponds to values lower than the value currently selected by the thumb (i.e., virtual knob).',
'::-moz-range-thumb': `The ::-moz-range-thumb CSS pseudo-element is a Mozilla extension that represents the thumb (i.e., virtual knob) of an <input> of type="range". The user can move the thumb along the input's track to alter its numerical value.`,
'::-moz-range-track': 'The ::-moz-range-track CSS pseudo-element is a Mozilla extension that represents the track (i.e., groove) in which the indicator slides in an <input> of type="range".',
'::-webkit-progress-inner-element': 'The ::-webkit-progress-inner-element CSS pseudo-element represents the outermost container of the <progress> element. It is the parent of the ::-webkit-progress-bar pseudo-element.',
'::grammar-error': 'The ::grammar-error CSS pseudo-element represents a text segment which the user agent has flagged as grammatically incorrect.',
'::placeholder': 'The ::placeholder CSS pseudo-element represents the placeholder text of a form element.',
'::spelling-error': 'The ::spelling-error CSS pseudo-element represents a text segment which the user agent has flagged as incorrectly spelled.'
}
} |
@octref I wasn't able to get to a working solution within time. Thanks for all the help, will keep looking to contribute in the future 👍 |
CSS autocomplete does not know 'focus-within' css property. It's currently in use with all modern browsers excluding Edge as listed on caniuse
My setup:
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: