This repository was archived by the owner on Jul 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +39
-19
lines changed Expand file tree Collapse file tree 4 files changed +39
-19
lines changed Original file line number Diff line number Diff line change @@ -504,26 +504,19 @@ viewPerspective env =
504
504
Codebase _ ->
505
505
UI . nothing
506
506
507
- Namespace { codebaseHash , fqn } ->
507
+ Namespace { fqn } ->
508
508
let
509
- fqnText =
510
- FQN . toString fqn
511
-
512
- context =
513
- Env . appContextToString env. appContext
514
-
515
- back =
516
- Tooltip . tooltip
517
- ( Button . icon ( ChangePerspective ( Codebase codebaseHash)) Icon . arrowLeftUp |> Button . small |> Button . uncontained |> Button . view)
518
- ( Tooltip . Text ( " You're currently viewing a subset of " ++ context ++ " (" ++ fqnText ++ " ), click to reveal everything." ))
519
- |> Tooltip . withArrow Tooltip . Start
520
- |> Tooltip . view
509
+ -- Imprecise, but close enough, approximation of overflowing,
510
+ -- which results in a slight faded left edge A better way would
511
+ -- be to measure the DOM like we do for overflowing docs, but
512
+ -- thats quite involved...
513
+ isOverflowing =
514
+ fqn |> FQN . toString |> String . length |> ( \ l -> l > 20 )
521
515
in
522
516
header
523
- [ class " perspective" ]
524
- [ div [ class " namespace-slug" ] []
525
- , h2 [] [ FQN . view fqn ]
526
- , back
517
+ [ classList [ ( " perspective" , True ) , ( " is-overflowing" , isOverflowing ) ] ]
518
+ [ UI . namespaceSlug
519
+ , h2 [ class " namespace" ] [ FQN . view fqn ]
527
520
]
528
521
529
522
Original file line number Diff line number Diff line change @@ -66,3 +66,8 @@ divider =
66
66
charWidth : Int -> String
67
67
charWidth numChars =
68
68
String . fromInt numChars ++ " ch"
69
+
70
+
71
+ namespaceSlug : Html msg
72
+ namespaceSlug =
73
+ div [ class " namespace-slug" ] []
Original file line number Diff line number Diff line change 192
192
display : flex;
193
193
flex-direction : row;
194
194
position : relative;
195
+ gap : 0.75rem ;
195
196
}
196
197
197
198
# main-sidebar .perspective : after {
209
210
}
210
211
211
212
# main-sidebar .perspective .namespace-slug {
212
- margin-right : 0.75 rem ;
213
+ position : relative ;
213
214
}
214
215
215
- # main-sidebar .perspective h2 {
216
+ # main-sidebar .perspective .is-overflowing .namespace-slug : after {
217
+ position : absolute;
218
+ top : 0 ;
219
+ right : -1.5rem ;
220
+ bottom : 0 ;
221
+ content : "" ;
222
+ width : 1.5rem ;
223
+ background : linear-gradient (
224
+ 90deg ,
225
+ var (--color-sidebar-bg ),
226
+ var (--color-sidebar-bg ),
227
+ var (--color-sidebar-bg-transparent )
228
+ );
229
+ }
230
+
231
+ # main-sidebar .perspective .namespace {
232
+ display : inline-flex;
216
233
color : var (--color-sidebar-fg-em );
217
234
font-size : 1rem ;
218
235
font-weight : 500 ;
219
236
height : 1.5rem ;
237
+ overflow : hidden;
238
+ white-space : nowrap;
239
+ text-align : right;
240
+ flex-direction : row-reverse;
220
241
}
221
242
222
243
# main-sidebar .perspective .tooltip-bubble {
Original file line number Diff line number Diff line change 174
174
/* Namespace Slug */
175
175
.namespace-slug {
176
176
display : inline-flex;
177
+ flex : 0 0 1.5rem ;
177
178
width : 1.5rem ;
178
179
height : 1.5rem ;
179
180
background : url(../ img/namespace-slug-untitled.svg);
You can’t perform that action at this time.
0 commit comments