-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Gutenberg frontend style.css has admin CSS #11668
Comments
Another bit that clearly doesn't belong in here: .editor-block-list__layout .reusable-block-edit-panel{
align-items:center;
background:#f8f9f9;
color:#555d66;
display:flex;
flex-wrap:wrap;
font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;
font-size:13px;
position:relative;
top:-14px;
margin:0 -14px -14px;
padding:8px 14px
}
.editor-block-list__layout .editor-block-list__layout .reusable-block-edit-panel{
margin:0 -14px;
padding:8px 14px
}
.editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__spinner{
margin:0 5px
}
.editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__info{
margin-right:auto
}
.editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__label{
margin-right:8px;
white-space:nowrap;
font-weight:600
}
.editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__title{
flex:1 1 100%;
font-size:14px;
height:30px;
margin:4px 0 8px
}
.editor-block-list__layout .reusable-block-edit-panel .components-button.reusable-block-edit-panel__button{
flex-shrink:0
}
@media (min-width:960px){
.editor-block-list__layout .reusable-block-edit-panel{
flex-wrap:nowrap
}
.editor-block-list__layout .reusable-block-edit-panel .reusable-block-edit-panel__title{
margin:0
}
.editor-block-list__layout .reusable-block-edit-panel .components-button.reusable-block-edit-panel__button{
margin:0 0 0 5px
}
}
.editor-block-list__layout .reusable-block-indicator{
background:#fff;
border-left:1px dashed #e2e4e7;
color:#555d66;
border-bottom:1px dashed #e2e4e7;
top:-14px;
height:30px;
padding:4px;
position:absolute;
z-index:1;
width:30px;
right:-14px
} All of this seems editor CSS to me. |
Note that the above examples are from minified files that I "unminified", code might not look like that in the source :) |
Agreed with the issues mentioned here: (about the animations, the reusable one need further investigation) We have an I suggest removing this file by doing something like:
|
This PR maybe fixes #11673, maybe fixes #11668. At least, this is the intention. It does two things: - It changes the naming scheme for all animations. Instead of having a mix of underscores and dashes for word separation, it uses BEM (to the best of my ability) to add consistency and a new naming convention for all animations. - It adds a prefix to all animations, indicating they are for the editor. Though perhaps we should have a more _admin_ specific prefix given these might one day be used outside the admin? - It moves all keyframe animations out of the mixins file, and into the edit-post style. This is because keyframe definitions don't work well with mixins and are just duplicated. This PR has been tested for all the animations I could find that were using the ones defined. But please give me a sanity check. By the way I noticed the following two animations do not appear to be used: - editor-animation__animate-fade - editor-animation__move-background Should we remove those? Or can anyone recall where they were intended to be used?
A couple more I think:
|
This PR maybe fixes #11673, maybe fixes #11668. At least, this is the intention. It does two things: - It changes the naming scheme for all animations. Instead of having a mix of underscores and dashes for word separation, it uses BEM (to the best of my ability) to add consistency and a new naming convention for all animations. - It adds a prefix to all animations, indicating they are for the editor. Though perhaps we should have a more _admin_ specific prefix given these might one day be used outside the admin? - It moves all keyframe animations out of the mixins file, and into the edit-post style. This is because keyframe definitions don't work well with mixins and are just duplicated. This PR has been tested for all the animations I could find that were using the ones defined. But please give me a sanity check. By the way I noticed the following two animations do not appear to be used: - editor-animation__animate-fade - editor-animation__move-background Should we remove those? Or can anyone recall where they were intended to be used?
Gallery related, in #11668 (comment).
* Code Quality: Improve prefix, better scope, for animations This PR maybe fixes #11673, maybe fixes #11668. At least, this is the intention. It does two things: - It changes the naming scheme for all animations. Instead of having a mix of underscores and dashes for word separation, it uses BEM (to the best of my ability) to add consistency and a new naming convention for all animations. - It adds a prefix to all animations, indicating they are for the editor. Though perhaps we should have a more _admin_ specific prefix given these might one day be used outside the admin? - It moves all keyframe animations out of the mixins file, and into the edit-post style. This is because keyframe definitions don't work well with mixins and are just duplicated. This PR has been tested for all the animations I could find that were using the ones defined. But please give me a sanity check. By the way I noticed the following two animations do not appear to be used: - editor-animation__animate-fade - editor-animation__move-background Should we remove those? Or can anyone recall where they were intended to be used? * Address feedback. This retires a few animations, and moves others that are only used once to their respective scopes. * Address comment. Gallery related, in #11668 (comment). * Address feedback. * Address final point.
@jasmussen was this meant to be closed? I think maybe the There are still plenty of editor styles currently in the frontend CSS. Is there a reason these files are added to the front-end? https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/style.scss#L2-L3 |
|
Yeah I agree with @m-e-h. As much as I appreciate the work done in that pull that closed this, this still needs fixing. |
Always okay to reopen! Was out for the day when I received this ping. |
So should this file and this file be renamed to rather than here I'm not certain but they look like editor styles judging by the class names in those files.. |
Can we clarify what's missing here. I see a number of merged PRs, are there any styles lingering on the frontend still? |
A few days ago I went through the compiled frontend styles and found some, there's a PR on #24439 for them 👍 |
This is no longer an issue, all remaining admin styles were removed from front-facing styles so I'll go ahead and close this ticket. 🎉 |
Describe the bug
On the frontend, every site with Gutenberg gets
block-library/style.css
loaded. That file contains CSS that is meant for the backend, like this:To Reproduce
Steps to reproduce the behavior:
block-library/style.css
Expected behavior
This should not be included in that CSS file.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: