-
-
Notifications
You must be signed in to change notification settings - Fork 132
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 selector discussion #9
Comments
I think this should be a change for Lumino 2.0. |
So you think it should be a "yes" ... eventually? Do you think there's room for just leaving them as is or do you consider it too much of an inconsistency in nomenclature to keep the |
I think the community around Lumino is just starting, and it's more valuable in the long term to have So my intuition is "yes, at the earliest opportunity, which is 2.0". |
In fact, I think if that is our decision, we should add |
This is a good idea. |
nevermind, my mind read things to me incorrectly |
We won't remove it. We'll add a note that the selector is deprecated, but it will continue to work until 2.0 and the |
Hm.
Edit: Perhaps we can. I'm still exploring this in: #20 |
Okay, so the crux of the question is encapsulated in this example CSS: /* <DEPRECATED> */
.p-TabBar-tab.p-mod-hidden,
/* </DEPRECATED> */
.lm-TabBar-tab.lm-mod-hidden {
display: none !important;
} The Actually, wouldn't every class need to be added in the TS code? This also doesn't seem like a great answer. |
In other words, are you asking if it should be as follows while it is deprecated? /* <DEPRECATED> */
.p-TabBar-tab.p-mod-hidden,
.lm-TabBar-tab.p-mod-hidden,
.p-TabBar-tab.lm-mod-hidden,
/* </DEPRECATED> */
.lm-TabBar-tab.lm-mod-hidden {
display: none !important;
} |
Or are you asking if, in Lumino code, we need to add I think the answer is yes, we need to add it while it is deprecated. |
The trouble is that it's not just the |
Correct, of course. What is the problem with that? That we have a combinatorial explosion of class name combinations? I think it is fine if we officially support in the documentation all |
I was imagining we would not be deleting any code adding classes. Just everywhere we added a (Too bad |
Hm, this actually means that we should not need to add the CSS styles like above at all. We only care about clients who target |
This is a good time to bring up the |
Good point. +1. |
I would say the distinction is kind of the opposite. |
@jasongrout That's a good point about the data attributes. I agree. |
Unless of course someone is adding the |
You are correct. But I think if we are deprecating these styles and the use you describe is so edge, I would propose not duplicating the styles in this transition phase. Do you agree with that or do you think it's important to copy the class as well? |
Well, I know of one project that are relying on them: https://github.com/jupyterlab/jupyterlab/search?q=p-mod-hidden&unscoped_q=p-mod-hidden |
Never heard of it. |
This is legacy and could be removed a long time ago: These uses are in tests, and arguably we should be using phosphor functions, not the css implementation detail: https://github.com/jupyterlab/jupyterlab/blob/8dc587729e5f2b2fa6087e854f0f988c0232802e/tests/test-apputils/src/toolbar.spec.ts#L201 https://github.com/jupyterlab/jupyterlab/blob/8dc587729e5f2b2fa6087e854f0f988c0232802e/tests/test-logconsole/src/widget.spec.ts#L48 and finally, here we are applying phosphor classes to non-phosphor objects. I think that is wrong and should not be supported: https://github.com/jupyterlab/jupyterlab/blob/76449838443b6ad679d3674f73a2932ac3d8f066/packages/apputils/src/toolbar.tsx#L611-L615 |
For completeness, these are the "adding classes to DOM" examples I could find in jupyterlab: Now, we can say that these are wrong and should not be supported. I'm just saying we should make such a decision with open eyes, and that thinking of cases such as these as "unlikely edge cases" would be a false premise to make the decision on. I would also argue that as part of #3 we should add a section "Styles/CSS" where we document (among other things) what is covered by semver, and what is not. |
I think one possible interpretation is that all classes that begin with
capital letters like the typescript classes (e.g., `.p-Widget`) are public
API. But I don't know. This is a hard problem.
For the purposes of this issue, I'm okay with punting and duplicating all
the classes with both prefixes until we have a more coherent plan.
…On Sat, 14 Dec 2019 at 14:05 Vidar Tonaas Fauske ***@***.***> wrote:
For completeness, these are the "adding classes to DOM" examples I could
find in jupyterlab:
https://github.com/jupyterlab/jupyterlab/blob/8d773bf136876315e1ff6b0483c5d15307d3cce7/packages/extensionmanager/src/widget.tsx#L700
https://github.com/jupyterlab/jupyterlab/blob/8d773bf136876315e1ff6b0483c5d15307d3cce7/packages/outputarea/src/widget.ts#L473
https://github.com/jupyterlab/jupyterlab/blob/8d773bf136876315e1ff6b0483c5d15307d3cce7/packages/statusbar/src/defaults/lineCol.tsx#L103
https://github.com/jupyterlab/jupyterlab/blob/8d773bf136876315e1ff6b0483c5d15307d3cce7/packages/ui-components/src/icon/tabbarsvg.ts#L135
Now, we can say that these are wrong and should not be supported. I'm just
saying we should make such a decision with open eyes, and that thinking of
cases such as these as "unlikely edge cases" would be a false premise to
make the decision on. I would also argue that as part of #3
<#3> we should add a section
"Styles/CSS" where we document (among other things) what is covered by
semver, and what is not.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9?email_source=notifications&email_token=AABG6KII4NQTRZFUEXPLONTQYTR4FA5CNFSM4JVMPVNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4DI7Y#issuecomment-565720191>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABG6KI6N5PTU26METKGTBLQYTR4FANCNFSM4JVMPVNA>
.
|
Going through these too: We should be using This is about removing classes, not adding classes. It looks like we just set the class to what we think is the original class. Kind of a kludge, but I think we're accepting there liability for updating that to This is not a phosphor class, so it wouldn't be impacted by the switch to Here we are overriding a phosphor class, so again, I think it's reasonable to ask us to change the css to |
I thought we were discussing "shortcuts" in deprecation for a non-major release, i.e. by not duplicating all CSS rules. |
I thought we were discussing duplicating all CSS rules for deprecation now (minor release), and eventually changing over in a major release. My point is that I think, after looking at how JLab is using (or abusing) phoshpor/lumino css classes, there is still not a critical blocker for eventually changing the css to be prefixed |
Should all of the legacy
p-*
CSS selectors be renamed tolm-*
?The text was updated successfully, but these errors were encountered: