Jump to content

MediaWiki:Common.css: Difference between revisions

From IoT Colabs Wiki
No edit summary
No edit summary
 
Line 11: Line 11:
#ca-protect { display: none !important; }
#ca-protect { display: none !important; }
#ca-viewsource { display: none !important; }
#ca-viewsource { display: none !important; }
/* Style the copy icon button */
/* Sticky Copy Button Styling */
.mw-highlight {
    position: relative;
    /* Ensure the container has a max-height or overflow for scrolling to trigger */
}
 
.copy-button {
.copy-button {
     position: absolute;
     position: sticky;   /* This makes it follow the scroll */
     top: 8px;
     top: 10px;           /* Distance from the top of the scrollable area */
     right: 8px;
     right: 10px;        /* Pinned to the right */
     width: 32px;
    float: right;       /* Keeps it aligned to the right side */
     height: 32px;
    margin-bottom: -40px; /* Offset to prevent pushing the code text down */
    margin-right: 10px;
   
     width: 34px;
     height: 34px;
     display: flex;
     display: flex;
     align-items: center;
     align-items: center;
     justify-content: center;
     justify-content: center;
     background-color: rgba(255, 255, 255, 0.8);
     background-color: rgba(255, 255, 255, 0.9);
     border: 1px solid #c8ccd1;
     border: 1px solid #c8ccd1;
     border-radius: 4px;
     border-radius: 6px;
     cursor: pointer;
     cursor: pointer;
     z-index: 10;
     z-index: 100;       /* Ensure it stays above the code lines */
     transition: all 0.2s ease;
     box-shadow: 0 2px 4px rgba(0,0,0,0.1);
     padding: 0; /* Clear default padding for flex centering */
     transition: background-color 0.2s, opacity 0.2s;
}
}


/* Make it look interactive */
.copy-button:hover {
.copy-button:hover {
     background-color: #ffffff;
     background-color: #ffffff;
     border-color: #36c;
     border-color: #36c;
     box-shadow: 0 1px 4px rgba(0,0,0,0.1);
     box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
}


.copy-button svg {
.copy-button svg {
     color: #54595d; /* Dark grey icon color */
     color: #54595d;
    display: block;
}
}


/* Optional: Make the button more visible on hover of the code block */
/* Hide button when not hovering over the code block (optional) */
.mw-highlight .copy-button {
.mw-highlight .copy-button {
     opacity: 0;
     opacity: 0.3;
}
}


.mw-highlight:hover .copy-button {
.mw-highlight:hover .copy-button {
     opacity: 1;
     opacity: 1;
}
/* Avoid showing button during print */
@media print {
    .copy-button { display: none; }
}
}

Latest revision as of 10:06, 6 May 2026

/* CSS placed here will be applied to all skins */
#ca-nstab-main { display: none !important; }	
#ca-nstab-user { display: none !important; }	
#ca-talk { display: none !important; }
#ca-view { display: none !important; }
#ca-history { display: none !important;}
#ca-watch { display: none !important; }
#ca-unwatch { display: none !important; }	
#ca-delete { display: none !important; }	
#ca-move { display: none !important; }
#ca-protect { display: none !important; }
#ca-viewsource { display: none !important; }
/* Sticky Copy Button Styling */
.mw-highlight {
    position: relative;
    /* Ensure the container has a max-height or overflow for scrolling to trigger */
}

.copy-button {
    position: sticky;    /* This makes it follow the scroll */
    top: 10px;           /* Distance from the top of the scrollable area */
    right: 10px;         /* Pinned to the right */
    float: right;        /* Keeps it aligned to the right side */
    margin-bottom: -40px; /* Offset to prevent pushing the code text down */
    margin-right: 10px;
    
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #c8ccd1;
    border-radius: 6px;
    cursor: pointer;
    z-index: 100;        /* Ensure it stays above the code lines */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s, opacity 0.2s;
}

/* Make it look interactive */
.copy-button:hover {
    background-color: #ffffff;
    border-color: #36c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.copy-button svg {
    color: #54595d;
}

/* Hide button when not hovering over the code block (optional) */
.mw-highlight .copy-button {
    opacity: 0.3;
}

.mw-highlight:hover .copy-button {
    opacity: 1;
}

/* Avoid showing button during print */
@media print {
    .copy-button { display: none; }
}