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

Missing styles in default theme #61

Closed
sopsick opened this issue Mar 20, 2020 · 14 comments
Closed

Missing styles in default theme #61

sopsick opened this issue Mar 20, 2020 · 14 comments

Comments

@sopsick
Copy link

sopsick commented Mar 20, 2020

The Lumino code appears to be switching the class naming conventions to lm-name_ rather than the Phosphor p-_name_ style. The @lumino/default-theme repo has not been updated with the new names. Specifically I noticed that the datagrid.css file is missing the styles that allow the cellEditors to work properly.

@jasongrout
Copy link
Contributor

Thanks! Do you want to put in a PR fixing this?

@afshin
Copy link
Member

afshin commented Mar 20, 2020

It looks like these issues came in with cell editing changes. One thing that also needs to be addressed is the .invalid class, which should be .lm-mod-invalid I imagine.

@jasongrout
Copy link
Contributor

CC also @mbektasbbg

@jasongrout
Copy link
Contributor

One thing that also needs to be addressed is the .invalid class, which should be .lm-mod-invalid I imagine.

+1. As a general rule, all css classes should be namespaced, which in css means prefixed :(.

@sopsick
Copy link
Author

sopsick commented Mar 20, 2020

Thanks! Do you want to put in a PR fixing this?

Looking at the git repo everything looks fine. It's the @lumino/default-theme in npm that has the problem. I have no idea how to update that. I think you just need to publish a new version.

@afshin
Copy link
Member

afshin commented Mar 20, 2020

Wait, is this actually a problem at all?

There was never a cell editor in the Phosphor data grid. So there should be no backward incompatibility with the new classes that have been created. (The .invalid class name still needs to be lm-mod-invalid, though.)

@afshin
Copy link
Member

afshin commented Mar 20, 2020

I don't think this is an actual backward-incompatible issue, because no consumer of @phosphor/datagrid ever had these new lm-* classes. If I am misunderstanding, please let me know. Otherwise, I propose closing this issue.

@jasongrout
Copy link
Contributor

Looking at the git repo everything looks fine. It's the @lumino/default-theme in npm that has the problem. I have no idea how to update that. I think you just need to publish a new version.

According to this, it sounds like everything actually is fine in master...

except for:

(The .invalid class name still needs to be lm-mod-invalid, though.)

@sopsick
Copy link
Author

sopsick commented Mar 21, 2020

Yes everything is fine in master but people using the Lumino packages from npm will have some issues.

@afshin
Copy link
Member

afshin commented Mar 21, 2020

This is the datagrid.css file I see in the NPM package for @lumino/default-theme version 0.2.4. It looks correct to me. It is identical to master.

/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2018, PhosphorJS Contributors
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/


/* <DEPRECATED> */ .p-DataGrid, /* </DEPRECATED> */
.lm-DataGrid {
  min-width: 64px;
  min-height: 64px;
  border: 1px solid #A0A0A0;
}


/* <DEPRECATED> */ .p-DataGrid-scrollCorner, /* </DEPRECATED> */
.lm-DataGrid-scrollCorner {
  background-color: #F0F0F0;
}


/* <DEPRECATED> */ .p-DataGrid-scrollCorner::after, /* </DEPRECATED> */
.lm-DataGrid-scrollCorner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  background-color: #A0A0A0;
}

.lm-DataGrid-cellEditorOccluder {
  pointer-events: none;
  position: absolute;
  overflow: hidden;
}

.lm-DataGrid-cellEditorContainer {
  pointer-events: auto;
  position: absolute;
  background-color: #ffffff;
  box-sizing: border-box;
  box-shadow: 0px 0px 6px #006bf7;
  border: 2px solid #006bf7;
}

.lm-DataGrid-cellEditorContainer.invalid {
  box-shadow: 0px 0px 6px red;
  border: 2px solid red;
}

.lm-DataGrid-cellEditorContainer > form {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lm-DataGrid-cellEditorWidget {
  width: 100%;
  height: 100%;
  outline: none;
  box-sizing: border-box;
}

.lm-DataGrid-cellEditorInput {
  background-color: #ffffff;
  border: 0;
}

.lm-DataGrid-cellEditorCheckbox {
  margin: 0;
}

.lm-DataGrid-notification {
  position: absolute;
  display: flex;
  overflow: visible;
  animation: fade-in 300ms ease-out;
}

.lm-DataGrid-notificationContainer {
  box-shadow: 0px 2px 5px #999999;
  border-radius: 3px;
  background-color: white;
  color: black;
  border: 1px solid black;
  font-family: sans-serif;
  font-size: 13px;
  padding: 4px;
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

@afshin
Copy link
Member

afshin commented Mar 21, 2020

If you compare the files:

wget https://registry.npmjs.org/@lumino/default-theme/-/default-theme-0.2.4.tgz
wget https://raw.githubusercontent.com/jupyterlab/lumino/master/packages/default-theme/style/datagrid.css
tar -xzf default-theme-0.2.4.tgz
diff package/style/datagrid.css datagrid.css

There is no difference.

@sopsick
Copy link
Author

sopsick commented Mar 21, 2020

My apologies. I just double checked my repo and it was pulling and older version. Sorry about that.

@sopsick sopsick closed this as completed Mar 21, 2020
@vidartf
Copy link
Member

vidartf commented Mar 23, 2020

Do we still want to use this issue to track .invalid ?

@sopsick
Copy link
Author

sopsick commented Mar 23, 2020

I would suggest opening a new one for the invalid issue so as not to confuse with the amateur mistake I made.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants