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

Fix SCSS Warnings #534

Merged
merged 16 commits into from
Oct 19, 2023
Merged

Fix SCSS Warnings #534

merged 16 commits into from
Oct 19, 2023

Conversation

MatthewKennedy
Copy link
Contributor

@MatthewKennedy MatthewKennedy commented Dec 12, 2022

  • Add StyleLint
  • Clean up SCSS
  • Fix any warnings
  • Add Github Workflow to run Style Lint
  • Removed 2 reported unrecognised css properties

@@ -97,6 +96,5 @@
overflow-y: auto;
overflow-x: hidden;
max-height: $select-max-height-dropdown;
overflow-scrolling: touch;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrecognised style, this might want putting back in and the style lint rule silencing.
It might get picked up by postCSS down the line and auto-prefixer might add --webkit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the build CSS is compiled this is not prefixed with --webkit-

$select-color-text: gray("800") !default; //$gray-800
$select-color-highlight: rgba(255,237,40,0.4) !default;
$select-color-text: gray("800") !default; // $gray-800
$select-color-highlight: rgb(255 237 40 / 40%) !default;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Double check that these modern colors work as expected, if not silence the style lint rule and convert back to classic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These colors compile down to standard colors okay in the build output CSS.

$select-color-optgroup: $dropdown-bg !default;
$select-color-optgroup-text: $dropdown-header-color !default;
$select-color-optgroup-border: $dropdown-divider-bg !default;
$select-color-dropdown: $dropdown-bg !default;
$select-color-dropdown-border-top: mix($input-border-color, $input-bg, 0.8) !default;
$select-color-dropdown-border-top: mix($input-border-color, $input-bg, 0.8%) !default;
Copy link
Contributor Author

@MatthewKennedy MatthewKennedy Dec 12, 2022

Choose a reason for hiding this comment

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

Fix for latest SASS release depreciation warning.

Copy link
Member

Choose a reason for hiding this comment

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

This should be 80% and not 0.8% right? https://github.com/orchidjs/tom-select/pull/529/files

@@ -159,7 +150,6 @@ $select-spinner-border-color: $select-color-border !default;
font-family: $select-font-family;
font-size: $select-font-size;
line-height: $select-line-height;
font-smoothing: $select-font-smoothing;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another unrecognised property, and its accompanying SCSS var, removed, might want putting back in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the build CSS is compiled this is not prefixed with --webkit-

display:flex;
align-items: center;

&.dropdown -active {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was removed, because the SCSS as it was did nothing &.dropdown -active is not valid, and looking at the html, I can't see any instance of a .dropdown-active inside a .ts-control

@oyejorge
Copy link
Member

Ok, there's a lot to look over here. In the future, it would be better to submit multiple pull requests.

@MatthewKennedy
Copy link
Contributor Author

Sorry about that, got a bit carried away.

Comment on lines 198 to 199

// box-shadow: none;
Copy link
Contributor

Choose a reason for hiding this comment

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

Linting is adding a space before comments, maybe these comments are not even necessary here ...

Suggested change
// box-shadow: none;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not, but I didn't write the original code so maybe it was a reminder for something, I'll remove those comments.

$select-color-optgroup: $dropdown-bg !default;
$select-color-optgroup-text: $dropdown-header-color !default;
$select-color-optgroup-border: $dropdown-divider-bg !default;
$select-color-dropdown: $dropdown-bg !default;
$select-color-dropdown-border-top: mix($input-border-color, $input-bg, 0.8) !default;
$select-color-dropdown-border-top: mix($input-border-color, $input-bg, 0.8%) !default;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
$select-color-dropdown-border-top: mix($input-border-color, $input-bg, 0.8%) !default;
$select-color-dropdown-border-top: mix($input-border-color, $input-bg, 80%) !default;

Isn't this one also 80%?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look at this and get back to you this afternoon.

Comment on lines 17 to 38
$select-ns: 'ts' !default;
$select-font-family: inherit !default;
$select-font-size: 13px !default;
$select-line-height: 18px !default;
$select-color-text: #303030 !default;
$select-color-border: #d0d0d0 !default;
$select-color-highlight: rgb(125 168 208 / 20%) !default;
$select-color-input: #fff !default;
$select-color-input-full: $select-color-input !default;
$select-color-disabled: #fafafa !default;
$select-color-item: #f2f2f2 !default;
$select-color-item-text: $select-color-text !default;
$select-color-item-border: #d0d0d0 !default;
$select-color-item-active: #e8e8e8 !default;
$select-color-item-active-text: $select-color-text !default;
$select-color-item-active-border: #cacaca !default;
$select-color-dropdown: #fff !default;
$select-color-dropdown-border: $select-color-border !default;
$select-color-dropdown-border-top: #f0f0f0 !default;
$select-color-dropdown-item-active: #f5fafd !default;
$select-color-dropdown-item-active-text: #495c68 !default;
$select-color-dropdown-item-create-text: rgba(red($select-color-text), green($select-color-text), blue($select-color-text), 50%) !default;
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look to be aligned, how does the lint let them through?
Maybe there should be no tabs, only always a space, between attributes and values attribute: value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They line up in the editor okay, but converted tabs to spaces.

Copy link
Member

Choose a reason for hiding this comment

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

FYI: Here's the editorconfig file for tom-select. I know there are arguments for both tabs and spaces, but I prefer tabs.

@sdebacker
Copy link

It should be great to test and merge this pull request.

@garak
Copy link

garak commented Jun 3, 2023

It should be great to test and merge this pull request.

I agree, but I see that this repository had the last merged pull request last December.
Moreover, no commits in the last six months. I'm afraid it's abandoned...

@ToshY
Copy link
Contributor

ToshY commented Jul 2, 2023

It should be great to test and merge this pull request.

I agree, but I see that this repository had the last merged pull request last December. Moreover, no commits in the last six months. I'm afraid it's abandoned...

@oyejorge Are you still willing/planning to maintain tom-select or is it getting abandoned?

@craigh
Copy link

craigh commented Jul 26, 2023

https://www.npmjs.com/package/@remotedevforce/tom-select implements this solution and also solves some other issues if you wish to try it.

@oyejorge oyejorge merged commit a93c839 into orchidjs:master Oct 19, 2023
1 check failed
oyejorge added a commit that referenced this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants