You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<main><header><h2>Must select the link</h2><navclass="nav-bad"><ul><li><ahref="#">Design</a></li><li><ahref="#">Components</a></li><li><ahref="#">Develop</a></li><li><ahref="#">Resources</a></li><li><ahref="#">Blog</a></li></ul></nav><h2>Select the box area</h2><navclass="nav-good"><ul><li><ahref="#">Design</a></li><li><ahref="#">Components</a></li><li><ahref="#">Develop</a></li><li><ahref="#">Resources</a></li><li><ahref="#">Blog</a></li></ul></nav></header></main>
As you will position borders using an absolute positioning with z-index,
you need to set the relative positioning and isolate so that z-index doesn't affect the rest of the document.
CSS variables defined here will be available to children. --offset is the border width.
Create a transparent button without anchor underline.
The size should use the dimension defined in main element.
transition makes the color change more graceful, less jumpy.
.button {
width:var(--width);
height:var(--height);
text-decoration: none;
color: white;
background: transparent;
transition: color 0.3s ease-in-out;
/* rest is for setting link style/position */
...
}
Button Background
The content area of .button::before will provide the button background.
Absolutely position the background smaller than half of offset on each side (top/left/width/height). to show the border through it. z-index: -1 will let .button content (<span>View All</span>) to show up on top of the background.
The main content's background color is applied in ::before, while the border color is in ::after.
.box::before {
background:#000;
}
/* Background linear gradient here is shown as a border */
.box::after {
/* a cool background copied from GH Universe */background:linear-gradient(
269.16deg,#ffe580-15.83%,#ff7571-4.97%,#ff727015.69%,#ea5dad32.43%,#c2a0fd50.09%,#9867f067.47%,#3bf0e484.13%,#33ce43105.13%,#b2f4b6123.24%
);
}
Showing Borders
For the :before content to show on top of :after, you need to set z-index values. z-index in :before is higher than that of :after but lower than that of current block.
The above code will work for a box only.
("borders" will overlap with other boxes without following instruction.)
To show a list of boxes, you need to wrap each block element with another block element, with position: relative applied.
Or else "borders" will overlap because of position: absolute for the box.
When you use React with TypeScript, you have have seen an error like this.
Type '{ "--language-color": string; }' is not assignable to type 'Properties<string | number, string & {}>'.
Object literal may only specify known properties, and '"--language-color"' does not exist in type 'Properties<string | number, string & {}>'.
The expected type comes from property 'style' which is declared here on type 'DetailedHTMLProps<HTMLAttributes, HTMLElement>'
Flashing Moonlander on Ubuntu (I am using 21.04) caused following error in console.
warning OpenDevices: libusb: bad access [code -3]
Fixes
Install dependency
sudo apt install libusb-dev
Create a udev rule file
sudo touch /etc/udev/rules.d/50-wally.rules
Add Moonlander configuration in the rule file
# STM32 rules for the Moonlander and Planck EZ
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \
MODE:="0666", \
SYMLINK+="stm32_dfu"
When I matched gist:(.*?) I saw 328 matches. I can refer to the matched group (.*?), which contains dance2die/{gistID} using $1 (first match).
I can now append the gist link to the match with https://gist.github.com/$1.
VSCode shows the replacement string inline, and confirmed they work before replacing.