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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSS selector & variable naming rules #4162

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Jun 21, 2023

  • adjusts our stylelint config to have rules for selectors and variables

Part of #3760

@julieg18 julieg18 changed the title Add camelCase CSS naming rules Add CSS selector & variable naming rules Jun 23, 2023
@@ -10,8 +10,13 @@ module.exports = {
true,
{ ignorePseudoClasses: ['global'] }
],
'custom-property-pattern': null,
'selector-class-pattern': null,
'selector-class-pattern': [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set our selectors to camelCase and our variables to be kebab-case. We can also set our variables to be camelCase as well if preferred.

I vote we avoid combining the two like vscode does though.

@@ -826,6 +826,6 @@ $badge-size: 0.85rem;

p {
opacity: 0.6;
font-family: var(--vscode-font-family);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved all vscode variables to variables.scss since some VSCode variables use a combination of camelCase and kebab-case which need a disabling rule. Plus I think it makes it easier to reuse/edit variables in general.

@@ -1,7 +1,7 @@
import { Config } from 'vega-lite'

const foregroundColor = 'var(--vscode-editor-foreground)'
const backgroundColor = 'var(--vscode-editor-foreground-transparency-1)'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vscode-editor-foreground-transparency-1 actually isn't a real variable. It still ended up working though since all we needed to do in the config was undo the default white color.

@julieg18 julieg18 marked this pull request as ready for review June 26, 2023 14:52
@julieg18 julieg18 enabled auto-merge (squash) June 28, 2023 13:03
@codeclimate
Copy link

codeclimate bot commented Jun 28, 2023

Code Climate has analyzed commit a942a14 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.2% (0.0% change).

View more on Code Climate.

@julieg18 julieg18 merged commit 821b38f into main Jun 28, 2023
3 checks passed
@julieg18 julieg18 deleted the add-camel-case-css-selector-rules branch June 28, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants