-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Webview codicons: styling and interactions with codicons #352
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
ab4c227
4ac05e7
4f1be3f
695ac85
a7b1280
b9a3ee9
220903a
f07c99b
a3df7f8
c033e57
f1db243
af9cba7
abe95c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // @ts-ignore | ||
|
|
||
| // This script will be run within the webview itself | ||
| // It cannot access the main VS Code APIs directly. | ||
|
|
||
| function play() { | ||
| document.getElementById('play2').disabled = true; | ||
| document.getElementById('stop2').disabled = false; | ||
| } | ||
|
|
||
| function stop() { | ||
| document.getElementById('play2').disabled = false; | ||
| document.getElementById('stop2').disabled = true; | ||
| } | ||
|
|
||
| document.getElementById('play2').onclick = play; | ||
| document.getElementById('stop2').onclick = stop; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // @ts-ignore | ||
|
|
||
| // This script will be run within the webview itself | ||
| // It cannot access the main VS Code APIs directly. | ||
|
|
||
| function play() { | ||
| if (!document.getElementById('play1').classList.contains('disabled')) { | ||
| document.getElementById('play1').classList.add('disabled'); | ||
| document.getElementById('stop1').classList.remove('disabled'); | ||
| document.getElementById('iconBarStatus').innerText = 'playing' | ||
| } | ||
| } | ||
|
|
||
| function stop() { | ||
| if (!document.getElementById('stop1').classList.contains('disabled')) { | ||
| document.getElementById('play1').classList.remove('disabled'); | ||
| document.getElementById('stop1').classList.add('disabled'); | ||
| document.getElementById('iconBarStatus').innerText = 'stopped' | ||
| } | ||
| } | ||
|
|
||
| document.getElementById('play1').onclick = play; | ||
| document.getElementById('stop1').onclick = stop; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,5 +56,44 @@ h1 { | |
|
|
||
| #icons .icon .codicon { | ||
| font-size: 32px; | ||
| padding-bottom: 16px; | ||
| } | ||
|
|
||
| /* Codicon mouse events demo */ | ||
|
|
||
| div.iconBar .codicon { | ||
| font-size: 60px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| div.iconBar .disabled { | ||
| opacity: 0.3; | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| /* Codicons in buttons demo */ | ||
|
|
||
| div.iconButtonBar .iconButton .codicon { | ||
| font-size: 40px; | ||
| padding: 3px; | ||
| } | ||
|
|
||
| div.styledIcon .codicon { | ||
| font-size: 50px; | ||
| color: green; | ||
|
||
| padding: 3px; | ||
| } | ||
|
|
||
| /* Rotating the 'loading' Codicon to indicate _progress_. */ | ||
|
|
||
| .rotate { | ||
| animation: rotation 2s infinite linear; | ||
| } | ||
|
|
||
| @keyframes rotation { | ||
| from { | ||
| transform: rotate(0deg); | ||
| } | ||
| to { | ||
| transform: rotate(359deg); | ||
| } | ||
jan-dolejsi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.