-
Notifications
You must be signed in to change notification settings - Fork 306
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
Enhance: refactor editor CSS #1365
Conversation
I don't understand why is this needed? |
As you rework the CSS editor, can you take in consideration these 2 old requests: |
While fixing #1358 (comment), I found that our CSS code depends on many global states and it has to work with JS. Including cross browser bugs (I didn't see #1358 (comment) in FF), unused rules, conflicted rules, Goals in this PR:
Another thing that can be done in the future is to separate compact UI from normal UI, or build the UI from mobile first (which starts with less rules). Therefore, you don't have to worry about breaking compact layout when editing normal rules (or vice versa). Note that this PR doesn't modify the editor but the CSS code which styles the editor page. |
I think you're overcomplicating and there's no need for this. It might be nice to do someday, but only as a part of a larger redesign. I'm against large refactors in HTML/CSS generally because they tend to break more than they solve. |
Also, I see the bug #1358 (comment) in FF. I'm using |
How about to treat this PR as part of a larger redesign?
|
If you want to do a redesign then you should start by making mock-ups so we can agree upon it first. Your screenshot shows the bug: the |
Basically, the UI/features will be the same as I mentioned in the first post. And the the final goal/benefit is described in #1365 (comment).
Do you mean you'd like to make the tabbar fixed instead of scrolling with the page? It should be a feature instead of a bug IMO. Currently they scroll with the page in non-compact UI. We can open an issue for that later. |
So the UI won't change, but it should change per my suggestion to use a modal + button to show it. Anyway, it's better to divide the PR into separate small changes and do them separately because there's no guarantee you don't add new bugs when doing a big refactor. If there's no big change in the UI then there's no need for a big refactor.
Do you mean you don't see the "Code" and "Settings" labels are obscured and thus unusable? |
This is exactly what I see both in FF and Chrome when I open the editor. Edit: your screenshot shows a scrolled window, which is not what the bug is about. |
BTW, that's the only thing that needs fixing at the moment, which is what I thought you would do, not refactoring. |
Seems like to see the bug you need a long first section so that it's taller than the window. |
I guess I don't really understand what the bug is (I thought I did). Anyway, if we want smaller PRs, I think we can:
This gives me the same feeling as refactoring 2000 lines |
Let's not split css or add more js files until we start using a build system because each additional file increases page load time. The editor is already wasting ~100ms on that, which is grating on my nerves every time I look at the profiler. Thus, let's postpone extracting, reusing, isolating stuff until that time. Since this PR is only about such refactoring I think it should be abandoned. I can fix the bug myself if you still can't reproduce it after my last comment above. |
Actually, the bug should go away if you simply restore the previous state of the editor before #1358 and implement the UI the way I suggested initially: in a modal shown after pressing a button. |
Oh, I see you've added 5 external files that load synchronously (in the critical render path) in that PR, which is unacceptable. When you or I switch the UI to a modal, the files should be loaded on demand, after the button is clicked. |
Closing because it adds more problems than it solves. |
Since I didn't follow UI development, I can only guess what we tried to do from the code:
fixed-header
, which is enabled when in compact mode & sections editor & scroll down a bit.editor.options.compact.expanded
While trying to accomplish these goals, I also re-arranged the code so selectors belong to the same section are grouped together.