-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improve the frontend guideline #23298
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delvh
approved these changes
Mar 5, 2023
GiteaBot
added
the
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
label
Mar 5, 2023
lunny
approved these changes
Mar 5, 2023
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Mar 5, 2023
lunny
added
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
and removed
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
labels
Mar 5, 2023
yardenshoham
added
the
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
label
Mar 5, 2023
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #23298 +/- ##
==========================================
+ Coverage 47.56% 47.59% +0.02%
==========================================
Files 1143 1143
Lines 151171 151171
==========================================
+ Hits 71907 71943 +36
+ Misses 70763 70726 -37
- Partials 8501 8502 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
lunny
removed
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Mar 5, 2023
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 6, 2023
* giteaofficial/main: (28 commits) Update hacking-on-gitea-zh_cn documentation (go-gitea#23315) Fix broken code editor diff preview (go-gitea#23307) [skip ci] Updated translations via Crowdin Add context when rendering labels or emojis (go-gitea#23281) Change interactiveBorder to fix popup preview (go-gitea#23169) Improve the frontend guideline (go-gitea#23298) Scoped labels: set aria-disabled on muted Exclusive option for a11y (go-gitea#23306) Add basic documentation for labels, including scoped labels (go-gitea#23304) [skip ci] Updated translations via Crowdin Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (go-gitea#23297) Add default owner team to privated_org and limited_org in unit test (go-gitea#23109) Improve sed detection in update-locales.sh (go-gitea#23254) Support sanitising the URL by removing extra slashes in the URL (go-gitea#21333) Make Ctrl+Enter submit a pending comment (starting review) instead of submitting a single comment (go-gitea#23245) Avoid panic caused by broken payload when creating commit status (go-gitea#23216) Add run status in action view page (go-gitea#23212) update to mermaid v10 (go-gitea#23178) Fix code wrap for unbroken lines (go-gitea#23268) Fix stray backticks appearing in pull request timeline (go-gitea#23282) Fill head commit to in payload when notifying push commits for mirroring (go-gitea#23215) ...
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The CustomEvent prefix
There was already
ce-quick-submit
, thece-
prefix seems better thanus-
. Rename the onlyus-
prefixedus-load-context-popup
toce-
prefixed.Styles and Attributes in Go HTML Template
#21855 (comment)
Suggest to stick to
class="c1 {{if $var}}c2{{end}}"
The readability and maintainability should be applied to the code which is read by developers, but not for the generated outputs.
The template code is the code for developers, while the generated HTML are only for browsers.
The
class="c1 {{if $var}}c2{{end}}"
style is clearer for developers and more intuitive, and the generated HTML also makes browsers happy (a few spaces do not affect anything)Think about a more complex case:
class="{{if $active}}active{{end}} menu item {{if $show}}show{{end}} {{if $warn}}warn{{end}}"
class="{{if $active}}active {{end}}menu item{{if $show}} show{{end}}{{if $warn}} warn{{end}}"
The first style make it clearer to see each CSS class name with its
{{if}}
block.