Skip to content

Commit

Permalink
refactor: Reorganize CSS styles and improve structure
Browse files Browse the repository at this point in the history
- Move box shadow and ellipsis styles to redefine-theme.styl
- Relocate page title header styles to page.styl
- Remove unused styles from basic.styl
- Clean up style.styl by removing redundant code
  • Loading branch information
EvanNotFound committed Nov 15, 2024
1 parent 2d34576 commit dfb3287
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
6 changes: 6 additions & 0 deletions source/css/common/basic.styl
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,9 @@ button
// ======================================================================
.clear
clear both

// ======================================================================
// text
// ======================================================================


20 changes: 20 additions & 0 deletions source/css/common/redefine-theme.styl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,23 @@ redefine-container(isTransform, scaleX, scaleY, padding, marginBottomValue)
+redefine-mobile()
padding: padding - 8
border-radius: $redefine-border-radius-large


.redefine-box-shadow
box-shadow var(--redefine-box-shadow)

.redefine-box-shadow-flat
box-shadow var(--redefine-box-shadow-flat)

@media (min-width: 640px)
.redefine-box-shadow:hover
box-shadow var(--redefine-box-shadow-hover)

.redefine-box-shadow-flat:hover
box-shadow var(--redefine-box-shadow)

.ellipsis
overflow hidden
text-overflow ellipsis
white-space nowrap
width 100%
7 changes: 7 additions & 0 deletions source/css/layout/page.styl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@require '../common/variables'

.page-title-header
font-size 3.2rem
line-height 1
font-weight bold
color var(--second-text-color)
margin 6px 0 36px 0

.page-container
position relative
box-sizing border-box
Expand Down
28 changes: 1 addition & 27 deletions source/css/style.styl
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,4 @@
@require 'layout/tag-content.styl'

if (hexo-config('home.sidebar.enable') == true)
@require 'layout/home-sidebar.styl'

.page-title-header
font-size 3.2rem
line-height 1
font-weight bold
color var(--second-text-color)
margin 6px 0 36px 0

.redefine-box-shadow
box-shadow var(--redefine-box-shadow)

.redefine-box-shadow-flat
box-shadow var(--redefine-box-shadow-flat)

@media (min-width: 640px)
.redefine-box-shadow:hover
box-shadow var(--redefine-box-shadow-hover)

.redefine-box-shadow-flat:hover
box-shadow var(--redefine-box-shadow)

.ellipsis
overflow hidden
text-overflow ellipsis
white-space nowrap
width 100%
@require 'layout/home-sidebar.styl'

0 comments on commit dfb3287

Please sign in to comment.